[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#10802: rmdir -p behaviour
From: |
Paul Ruane |
Subject: |
bug#10802: 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.
- bug#10802: rmdir -p behaviour,
Paul Ruane <=