bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mv trailing slash warning


From: Eric Blake
Subject: Re: mv trailing slash warning
Date: Wed, 28 Sep 2005 23:05:31 +0000

> > On a related note, why don't rm and rmdir have a --strip-trailing-slashes
> > option?
> 
> Because as far as I know, there is no need.
> Do you know of a system where `rmdir symlink/'
> removes only the referent of the symlink?

By a strict reading of
http://www.opengroup.org/onlinepubs/009695399/utilities/rm.html,
'rm -R symlink/' should empty the referrant, then fail!

step 0: the command line does not end in .
step 1: symlink/ exists
step 2: 'symlink/' is of type directory ('symlink', on the other hand,
is of type symlink); this is the recursion, ending with the
referrant being emptied, and symlink and symlink/ still existing
step 3: 'symlink/' is a directory
step 4: call rmdir("symlink/"), which should fail with EINVAL

But no implementation of rm(1) that I am aware of does this;
they all unlink symlink and call it quits, leaving the referrant
(and its contents) alone.  We really do need to clean this up
with the austin group; surely they intended to document
historical behavior.

--
Eric Blake






reply via email to

[Prev in Thread] Current Thread [Next in Thread]