GNU bug report logs - #15926
RFE: unlink command already uses 'unlink' call; make 'rm' use 'remove' call

Previous Next

Package: coreutils;

Reported by: Linda Walsh <coreutils <at> tlinx.org>

Date: Tue, 19 Nov 2013 11:58:02 UTC

Severity: normal

Tags: notabug, patch

Merged with 15943

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #56 received at 15926 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Linda Walsh <coreutils <at> tlinx.org>
Cc: 15926 <at> debbugs.gnu.org, Eric Blake <eblake <at> redhat.com>,
 Bob Proulx <bob <at> proulx.com>
Subject: Re: bug#15926: RFE: unlink command already uses 'unlink' call; make
 'rm' use 'remove' call
Date: Thu, 21 Nov 2013 07:32:23 +0100
On 11/21/2013 01:48 AM, Linda Walsh wrote:
>     Isn't it my computer?  How do I override such a refusal?

That riddle isn't too hard, is it? ;-)

POSIX (and common sense) forbids to remove something ending on ".".
Therefore just use the canonicalized name, e.g.:

  $ mkdir /tmp/xx

  $ cd /tmp/xx

  $ rm -rv .
  rm: refusing to remove ‘.’ or ‘..’ directory: skipping ‘.’

  $ rm -rv "$(pwd -P)"
  removed directory: ‘/tmp/xx’

or alternatively (just the rm invocation):

  $ rm -rv "$(readlink -f .)"
  removed directory: ‘/tmp/xx’

As you were mentioning MS: the above obviously won't probably work
in Cygwin as the underlying (file) system may return EBUSY.

Have a nice day,
Berny




This bug report was last modified 6 years and 225 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.