Subject: Re: How do I delete an empty directory?
To: None <port-arm32@NetBSD.ORG>
From: Jasper Wallace <jasper@navaho.co.uk>
List: port-arm32
Date: 11/17/1997 11:49:45
On Sun, 16 Nov 1997, Ib-Michael Martinsen wrote:

>Hi there!
>
>The header says it all. I can delete a file using the unlink function,
>but when I use unlink on an empty directory, it returns -1 and errno
>is set to 21.
>
>'man errno' shows
>
>21 EISDIR Is a directory. An attempt was made to open a directory with
>             write mode specified.
>
>I guess the directory in case must be the parent directory to the one I
>want to delete. The user (owner) has write access to both directories.
>
>Furthermore, according to 'man unlink' the error EISDIR can not happen
>at all, so why does it?
>
>Is there any other way to delete a directory?
>

at the bottom of the man page for unlink there is a refrence to rmdir(2) in
the 'see also' section. it does exactly what you want ;-)

-- 
Jasper Wallace - Recovering Pre-Proto PFY (without the Pimples)
*Bugs coded* *Servers Shutdown* *hacks hacked* *mail lost* *routes re-routed*
*firewalls doused*  *discs trashed* *configurations broken* *code obsfucated* 
*demons killed*   *cables unplugged*    *deadlines ignored*   *machines hung*