coreutils
[Top][All Lists]
Advanced

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

Re: rm feature: don't attempt to remove the same file twice


From: Christian Groessler
Subject: Re: rm feature: don't attempt to remove the same file twice
Date: Thu, 1 Sep 2016 19:43:33 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 09/01/16 17:39, Ed Avis wrote:
In fact, 'rm -f a a' still does twice the filesystem operations.
It still calls newfstatat(AT_FDCWD, "a", ...) twice and unlinkat(AT_FDCWD, "a", 
0) twice, on my system.

What I am suggesting is to check for the same filename string having been seen 
before and avoid touching the filesystem.
This is a small user-friendliness improvement in the mode without -f, since 
"warning: file 'a' specified twice" is easier to understand
than "cannot remove 'a': No such file or directory", but it is also a 
performance improvement.
Pretty marginal I admit, except perhaps for a network filesystem hosted by a 
server on the other side of the planet.


If you say "rm a a", you get what you asked for.
You wanted to remove "a" twice, and this normally doesn't work.
I don't see a reason for a change.

just my 2cts

chris




reply via email to

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