This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 1.3.2 rmdir fails if CWD is in the directory to be deleted?


On Sat, Sep 08, 2001 at 04:45:24AM +0000, John William wrote:
>I just installed Cygwin and am having the following problem with rmdir() -- 
>it fails if the CWD is set to the directory to be deleted.
>
>main()
>{
> mkdir("test");
> rmdir("test"); <-- succeeds
>
> mkdir("test");
> chdir("test");
> rmdir("test"); <-- fails
>}
>
>This is different than standard UN*X. It appears to me that POSIX only 
>requires that the directory be empty, it doesn't say that the CWD can't be 
>set to the directory to be deleted.
>
>Is this a known issue? It is causing problems with some programs I'm trying 
>to compile (they work fine under RH Linux, DJGPP and FreeBSD). Please e-mail 
>any reponses, as I am not subscribed to the mailing list. Thanks!

Welcome to Windows.  If Windows can't delete a directory while it is the
current directory of some process then there is no way that Cygwin can
do this either.

The Single Unix Specification does seem to imply that deleting the current
working directory should succeed but there are some UNIX systems out there
that don't adhere to this.  For instance, I just tried this on IRIX 5.3
and it failed to rmdir a directory if I was cd'ed to it.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]