[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#10802: rmdir -p behaviour
From: |
Jim Meyering |
Subject: |
bug#10802: rmdir -p behaviour |
Date: |
Tue, 14 Feb 2012 18:04:47 +0100 |
Paul Eggert wrote:
> On 02/14/2012 07:53 AM, Jim Meyering wrote:
>> we'd have to defer removing a/ until the last argument,
>> and to know that we need to handle this unusual case, we'd have to
>> inspect each of the intervening arguments.
>
> There's a better way. Put all the "I can't remove a
> parent directory" diagnostics into a data structure rather than
> issuing them immediately. Then, at the end of the "rm", check
> whether the directories still exist. Output the diagnostics
> only for directories that still exist.
>
> This still requires RAM, but only for the unusual case where
> the rmdirs fail.
>
> Still not sure it's worth it, though....
I should have asked up front,
Have you considered the --ignore-fail-on-non-empty option?
--ignore-fail-on-non-empty
ignore each failure that is solely because a directory
is non-empty