delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/02/20/07:16:31

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sun, 20 Feb 2011 13:15:56 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Please test latest developer snapshot
Message-ID: <20110220121556.GO29762@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20110217120400 DOT GB29762 AT calimero DOT vinschen DOT de> <4D600C0A DOT 9080305 AT etr-usa DOT com> <4D600D62 DOT 4090008 AT etr-usa DOT com> <4D602970 DOT 8070100 AT etr-usa DOT com>
MIME-Version: 1.0
In-Reply-To: <4D602970.8070100@etr-usa.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Feb 19 13:34, Warren Young wrote:
> On 2/19/2011 11:35 AM, Warren Young wrote:
> >On 2/19/2011 11:29 AM, Warren Young wrote:
> >>$ rmdir .
> >>rmdir: failed to remove `.': Invalid argument
> >
> >Nevermind. It doesn't work on Linux, either. I guess /bin/rmdir has code
> >in it to check for that, which rmdir(2) does not.
> 
> Better test, which does work with 20110215, and which proves it's
> rmdir(1) being too clever, but not so clever it can't be outsmarted:
> 
> 	$ mkdir foo
> 	$ cd foo
> 	$ rmdir ../foo
> 
> Eat that, rmdir(1)!

It's not missing cleverness of rmdir(1) but by design of the rmdir(2)
function per POSIX.  See
http://pubs.opengroup.org/onlinepubs/9699919799/functions/rmdir.html

  "If the path argument refers to a path whose final component is either
   dot or dot-dot, rmdir() shall fail.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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