delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/09/08/09:13:39

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: "Ronald Landheer" <info AT rlsystems DOT net>
To: "Rick Rankin" <rick_rankin AT yahoo DOT com>, "John William" <jw2357 AT hotmail DOT com>,
<cygwin AT cygwin DOT com>
Subject: RE: 1.3.2 rmdir fails if CWD is in the directory to be deleted?
Date: Sat, 8 Sep 2001 14:59:53 +0200
Message-ID: <NFBBLOMHALONCDMPGBLFGELHCAAA.info@rlsystems.net>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
In-Reply-To: <20010908054857.87558.qmail@web10503.mail.yahoo.com>
Importance: Normal
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id JAA01657

Hm.. This should work.. I can easily delete the current dir in CygWin with the M$ Explorer, but do get a "permission denied" when I try it in cygwin. (If I do this:
$ cd
$ mkdir test
$ cd test
In explorer, delete p:\cygwin\home\RonaldLandheer\test
$ cd ..
I end up in ~/test/..

It would seem the _current_ process can't kill its own directory..
Would it be possible to fork, go a dir lower and destroy it from there? (Haven't tried it yet, but I'd expect the same results)

Greetz!

Ronald

-----Original Message-----
From: cygwin-owner AT sources DOT redhat DOT com
[mailto:cygwin-owner AT sources DOT redhat DOT com]On Behalf Of Rick Rankin
Sent: Saturday, September 08, 2001 7:49 AM
To: John William; cygwin AT cygwin DOT com
Subject: Re: 1.3.2 rmdir fails if CWD is in the directory to be deleted?


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

--- John William <jw2357 AT hotmail DOT com> 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
> 
> 
> _________________________________________________________________
> 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/
> 


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

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


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019