GNU bug report logs - #19051
rm symboliclink/ # "Is a directory"

Previous Next

Package: coreutils;

Reported by: aaron brick <abrick <at> ccsf.edu>

Date: Fri, 14 Nov 2014 07:20:01 UTC

Severity: normal

Tags: notabug

Full log


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

From: Pádraig Brady <P <at> draigBrady.com>
To: aaron brick <abrick <at> ccsf.edu>, 19051 <at> debbugs.gnu.org
Subject: Re: bug#19051: rm symboliclink/ # "Is a directory"
Date: Fri, 14 Nov 2014 11:41:57 +0000
tag 19051 notabug
close 19501
stop

On 14/11/14 06:53, aaron brick wrote:
> hi folks,
> 
> $ ln -s / sl
> $ rm sl/
> rm: cannot remove `sl/': Is a directory
> $ rm sl
> $
> 
> the presence of the slash is not such a great way to test for whether
> or not a file is a directory. you may find the above example
> contrived, but it occurs easily because bash's default tab completion
> for symlinks to directories adds the trailing slash. this confused the
> hell out of one of my students.
> 
> thanks for your hard work!
> aaron brick.

Confused me too when I encountered it first, but tt's required by POSIX:
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11

But now I see that coreutils rmdir is inconsistent and doesn't
treat sl/ as the directory. We should probably fix that up
to be consistent with other tools, POSIX and other systems.

thanks,

Pádraig.






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

Previous Next


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