On 11/19/2013 11:45 PM, Bernhard Voelker wrote:
On 11/20/2013 03:19 AM, Eric Blake wrote:
Yes, the 'rm -rf .' case appears to be a regression in coreutils that is
contrary to the behavior required by POSIX. That is:
$ mkdir /tmp/foo /tmp/foo/sub
$ cd /tmp/foo
$ rm -r .
rm: cannot remove
On 11/20/2013 02:44 PM, Eric Blake wrote:
On 11/19/2013 11:45 PM, Bernhard Voelker wrote:
Maybe cannot remove directory is a bit weak - it's more like
refusing to remove dot|dot-dot|root directory.
Indeed, a clearer error message would be possible.
What about the following?
$ src/rm -r
On 20/11/2013 16:03, Bernhard Voelker wrote:
$ src/rm -r src/.
src/rm: refusing to remove '.' or '..' directory: skipping 'src/.'
That gets back to what Bob mentioned about it being a
nanny-restriction.
The inevitable comment to be asked by someone is
Refuse?
Isn't it my
On 20/11/2013 15:47, Bernhard Voelker wrote:
- /* If a command line argument resolves to / (and --preserve-root
+ /* POSIX also says:
+ If a command line argument resolves to / (and --preserve-root
is in effect -- default) diagnose and skip it. */
On 11/20/2013 05:03 PM, Bernhard Voelker wrote:
On 11/20/2013 02:44 PM, Eric Blake wrote:
On 11/19/2013 11:45 PM, Bernhard Voelker wrote:
Maybe cannot remove directory is a bit weak - it's more like
refusing to remove dot|dot-dot|root directory.
Indeed, a clearer error message would be
On 11/20/2013 05:48 PM, Linda Walsh wrote:
I still think an ENV flag that lists the command
Environment variables that modify behavior are nasty, and should
generally be avoided when simpler solutions exist. In this case, I'd
much rather add a long option, 'rm --no-preserve-dot', and let you
forcemerge 15943 15926
thanks
On 11/20/2013 05:54 PM, Linda Walsh wrote:
On 20/11/2013 15:47, Bernhard Voelker wrote:
- /* If a command line argument resolves to / (and
--preserve-root
+ /* POSIX also says:
+ If a command line argument resolves to / (and
No
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
On 11/21/2013 03:07 AM, Eric Blake wrote:
On 11/20/2013 05:03 PM, Bernhard Voelker wrote:
What about the following?
$ src/rm -r src/.
src/rm: refusing to remove '.' or '..' directory: skipping 'src/.'
That helps.
Thanks, I'll push it unless someone comes up with a better wording.