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....
