-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
This is a suggestion for a possible feature (I found myself having to hand-roll the following recently, and figured it'd make for a good enhancement for File::Directory::Tree
).
Suppose you want to remove an empty directory (like rmdir
does), and then have that removal bubble up until you encounter a non-empty directory. So:
- for the path
/a/b/c/d
, if none of those directories have anything else inside, then running this command would remove all of them; - for the same path, if
a/b
also contains something else apart fromc
, then running this command on/a/b/c/d
would removec
but stop there (because afterwards/a/b
wouldn't be empty).
In short, something like rmtree but only callingrmdir
and notempty-directory
.
Perhaps whether rmtree
calls empty-directory
or not can be passed as a named parameter, defaulting to the current version.
Metadata
Metadata
Assignees
Labels
No labels