public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Randall R Schulz <rrschulz@cris.com>
To: "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: Fri, 07 Sep 2001 22:06:00 -0000	[thread overview]
Message-ID: <5.1.0.14.2.20010907214723.02408ff0@pop3.cris.com> (raw)
In-Reply-To: <F146hlbgwCpsCXsCLMy0000ad06@hotmail.com>

John,

I'm not sure I'd call it an "issue" since I don't think it's likely ever to 
be "resolved."

This reflects a restriction imposed by Windows that no file system entity 
that is in use (open file, program being executed, directory that is a 
current working directory, etc.) can be deleted.

Unix can accomplish this sort of thing (deletion of in-use file system 
entities) because of the strong distinction and separation between the name 
of a thing (a directory entry) and the thing itself (an inode, whether 
internal or on disk). "Real" Unix systems use internal reference counting 
(multiple levels of it, in fact) to defer actions like the removal of a 
file or directory (inode) independent of the removal of the entity's last 
referencing directory entry (which is the direct consequence of an unlink 
or rmdir call).

Simulating this in Cygwin would presumably require herculean hoop-jumping 
and major slight-of-hand and I tend to doubt the principals would consider 
it worth the effort.

In short, "Cygwin is not Unix" and this is one place where the distinction 
is manifest as a difference in operation.

Randall Schulz
Mountain View, CA USA


At 21:45 2001-09-07, 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!
>
>- John


--
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/

  parent reply	other threads:[~2001-09-07 22:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-07 21:45 John William
2001-09-07 22:01 ` Christopher Faylor
2001-09-08  4:07   ` Corinna Vinschen
2001-09-07 22:06 ` Randall R Schulz [this message]
2001-09-07 22:48 ` Rick Rankin
2001-09-08  6:12   ` Ronald Landheer
2001-09-08  6:53     ` Robert Collins
2001-09-09  6:14       ` Ronald Landheer
2001-09-08  7:53   ` Randall R Schulz
2001-09-09  8:49     ` Rick Rankin
2001-09-09 16:07     ` James Youngman
2001-09-09 16:40       ` Christopher Faylor
2001-09-10 10:47         ` James Youngman
2001-09-07 22:48 John William
2001-09-08  7:53 ` Randall R Schulz
2001-09-08 10:41 ` Christopher Faylor
2001-09-08 10:20 John William
2001-09-08 10:28 John William

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.1.0.14.2.20010907214723.02408ff0@pop3.cris.com \
    --to=rrschulz@cris.com \
    --cc=cygwin@cygwin.com \
    --cc=jw2357@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).