[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[debbugs-tracker] bug#10802: closed (rmdir -p behaviour)
From: |
GNU bug Tracking System |
Subject: |
[debbugs-tracker] bug#10802: closed (rmdir -p behaviour) |
Date: |
Wed, 15 Feb 2012 07:54:02 +0000 |
Your message dated Wed, 15 Feb 2012 08:51:49 +0100
with message-id <address@hidden>
and subject line Re: bug#10802: rmdir -p behaviour
has caused the debbugs.gnu.org bug report #10802,
regarding rmdir -p behaviour
to be marked as done.
(If you believe you have received this mail in error, please contact
address@hidden)
--
10802: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10802
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message ---
Subject: |
rmdir -p behaviour |
Date: |
Mon, 13 Feb 2012 11:59:29 +0000 |
Hi,
If I have the following directory structure:
> mkdir -p a/a1 a/a2
If I then remove these empty directories using the --parents option,
rmdir reports an error:
> rmdir --parents a/a1 a/a2
rmdir: failed to remove directory `a': Directory not empty
Despite the error, the command completes with the desired result.
It is pretty obvious what is happening: rmdir is treating each
argument in isolation:
1. argument 'a/a1'
1.1. attempt to remove 'a/a1': success
1.2. attempt to remove 'a': error as directory not empty
2. argument 'a/a2'
2.1. attempt to remove 'a/a2': success
2.2. attempt to remove 'a': success
However I would expect the parent directory removal to happen after
the arguments are removed, which would result in a better user
experience. For example:
1. argument 'a/a1'
1.1. attempt to remove 'a/a1': success
1.2. remember parent 'a'
2. argument 'a/a2'
2.1. attempt to remove 'a/a2': success
2.2. parent 'a' already in set of parents
3. remembered parent 'a'
3.1. remove parent 'a': success
Many thanks,
Paul.
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#10802: rmdir -p behaviour |
Date: |
Wed, 15 Feb 2012 08:51:49 +0100 |
tags 10802 notabug
Paul Ruane wrote:
> On 14 February 2012 22:06, Jim Meyering <address@hidden> wrote:
>> I suggest you use find.
>> This does what you want, at least with GNU find:
>>
>> find a -depth -type d -empty -delete
>
> Wow, the wonders of find. I've set this up as a shell function 'rmd'.
> Many thanks for your suggestions.
;-)
closing as notabug.
--- End Message ---
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [debbugs-tracker] bug#10802: closed (rmdir -p behaviour),
GNU bug Tracking System <=