in reply to File::Path::rmtree: What am I not grokking?
In a few words,
mkpath creates a directory, even if it's parent does not exist.
rmtree deletes a directory, even if it's not empty.
rmtree works like the unix commnd rm -r. It recursivly deletes children, not parents. In other words, it deletes a directory, whether it's empty or not. For example, using rmtree to delete /base/dir will delete /base/dir, /base/dir/a, /base/dir/a/1 and /base/dir/b.
I don't know of anything that does what you want with a single command.
And while we're talking about File::Path ... is the / following 'mkpath' and preceding 'foo' an error?
The leading slash makes it an absolute path. If you omit the leading slash, the path is relative to the current directory. Both are valid, but have different meanings.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File::Path::rmtree: What am I not grokking?
by Aristotle (Chancellor) on Nov 02, 2005 at 22:06 UTC | |
|
Re^2: File::Path::rmtree: What am I not grokking?
by jkeenan1 (Deacon) on Nov 02, 2005 at 22:19 UTC | |
by ikegami (Patriarch) on Nov 02, 2005 at 22:26 UTC | |
by Aristotle (Chancellor) on Nov 02, 2005 at 22:31 UTC | |
by jkeenan1 (Deacon) on Nov 03, 2005 at 15:55 UTC | |
by Aristotle (Chancellor) on Nov 03, 2005 at 18:46 UTC |