[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: |
Adam Brenner |
Subject: |
Re: rm feature: don't attempt to remove the same file twice |
Date: |
Thu, 1 Sep 2016 08:14:00 -0700 |
On Thu, Sep 1, 2016 at 3:00 AM, Ed Avis <address@hidden> wrote:
> % touch a
> % rm a a
> rm: cannot remove 'a': No such file or directory
>
> It might be better for rm to remember that it has seen the filename 'a'
> before, and just warn rather than check the filesystem again.
> This would be a bit more user-friendly and a bit faster, if you accept
> that filesystem operations are slower than doing user-space checking of
> seen filenames.
> It would not catch 'rm a ./a' and similar cases but it would be an
> improvement.
>
> --
> Ed Avis <address@hidden>
> Please ignore autogenerated disclaimer below this point.
>
>
>
>
Ed,
Playing devil's advocate: if I do rm -rf * in a directory with
thousands of file, folders, links, sockets, etc. should rm keep all
the names in memory? That list of names could grow to be very large.
/adam
--
Adam Brenner
Senior Technologist, Advanced Development
EMC Core Technologies Division, CTO Office
address@hidden
Computer Science, B.S.
Donald Bren School of Information and Computer Sciences
University of California, Irvine
www.ics.uci.edu/~aebrenne/
address@hidden