This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: 1.3.2 rmdir fails if CWD is in the directory to be deleted?
- To: rrschulz at cris dot com, rick_rankin at yahoo dot com, cygwin at cygwin dot com
- Subject: Re: 1.3.2 rmdir fails if CWD is in the directory to be deleted?
- From: "John William" <jw2357 at hotmail dot com>
- Date: Sat, 08 Sep 2001 17:28:37
Actually, I'm a little confused about exactly what the standard says. It
seems that SuS doesn't really say (but seems to imply that it should work).
POSIX also implies that it should work as long as the directory is empty and
I have permissions to delete it.
Isn't the basic philosophy that "it works unless something says it won't"?
The only *requirement* I can find is that the directory be empty before
rmdir() can succeed.
I understand this may be a limitation of Windows but it is not a limitation
of the UN*X systems I've used (I don't have access to an IRIX machine). I do
know that this difference broke the first three programs I tried porting
from "true UN*X" to Cygwin.
- John
>From: Randall R Schulz <rrschulz@cris.com>
>To: Rick Rankin <rick_rankin@yahoo.com>, John William <jw2357@hotmail.com>,
> cygwin@cygwin.com
>Subject: Re: 1.3.2 rmdir fails if CWD is in the directory to be deleted?
>Date: Sat, 08 Sep 2001 07:53:01 -0700
>
>Rick,
>
>You should try it. On many Unix systems it will work just fine. After the
>rmdir call, no call that uses a relative file name will work, however,
>since the directory must have been empty to be removed and in doing so the
>.. link would have been removed.
>
>This applies to "classic" implementations on the Unix file system. Chris
>has pointed out that IRIX does not behave this way. Since those details are
>not part of the API specifications, the implementers get to do what they
>please. That's what it's all about when it comes to writing specifications
>(saying everything you mean and are willing to commit to and nothing you
>are not).
>
>Randall Schulz
>Mountain View, CA USA
>
>
>At 22:48 2001-09-07, Rick Rankin wrote:
>>Hmm. It looks to me like this should fail, even under Unix. Once you've
>>chdir'd
>>into test, it no longer exists at the current directory level. Shouldn't
>>the
>>sequence be
>>
>>mkdir("test");
>>chdir("test");
>>rmdir("../test");
>>
>>Of course, even this will fail under Windows because Windows won't allow
>>the
>>current directory to be deleted if it's in use by any process.
>>
>>--Rick
>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
--
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/