On 1 September 2016 at 16:39, Ed Avis <[email protected]> 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.
This looks valid to me rm a a there could be other process, such as touch a a running parallel. -- Sami Kerola http://www.iki.fi/kerolasa/
