in reply to Re: File::Path::rmtree: What am I not grokking?
in thread File::Path::rmtree: What am I not grokking?
I don't know of anything that does what you want with a single command.
How about this?
use File::Path; use File::Spec; use Test::More qw|no_plan|; my $tmp = "/Users/jimk/tmp"; chdir $tmp or die; my $partial = "alpha/beta/gamma"; mkpath($partial); ok(-d "$tmp/$partial", "$tmp/$partial created"); rmfromtop($partial); ok(! -d "$tmp/$partial", "$tmp/$partial deleted"); ok(! -d "alpha/beta", "alpha/beta deleted"); ok(! -d "alpha", "alpha deleted"); sub rmfromtop { rmtree((File::Spec->splitdir(+shift))[0]); }
jimk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: File::Path::rmtree: What am I not grokking?
by ikegami (Patriarch) on Nov 02, 2005 at 22:26 UTC | |
|
Re^3: File::Path::rmtree: What am I not grokking?
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 |