> -----Original Message----- > From: Tony Esposito [mailto:tony1234567...@yahoo.co.uk] > Sent: Thursday, May 14, 2009 12:02 > To: beginners@perl.org > Subject: Fw: deleting subdirectories only in Win32 > > It appears that, after doing more research, the keep_root > variable does not keep the \data folder intact but removes > it. Unless I am mistaken, is there another method to > cleaning a directory of files and subdirectories without > removing the directory itself? > (I know I can do it programmatically but I was wondering if > there was a '1-liner' like the one previously listed). > but that is not what the doc states: keep_root => $bool
When set to a true value, will cause all files and subdirectories to be removed, except the initially specified directories. This comes in handy when cleaning out an application's scratch directory. So I would at least get ahold of the maintainer: AUTHORS Tim Bunce and Charles Bailey. Currently maintained by David Landgren <da...@landgren.net>. What it is advertising and doing are not right. My 2 cents... If you have any questions and/or problems, please let me know. Thanks. Wags ;) David R. Wagner Senior Programmer Analyst FedEx Freight 1.719.484.2097 TEL 1.719.484.2419 FAX 1.408.623.5963 Cell http://fedex.com/us > > ----- Forwarded Message ---- > From: Tony Esposito <tony1234567...@yahoo.co.uk> > To: Beginners Perl <beginners@perl.org> > Sent: Wednesday, 13 May, 2009 12:56:45 > Subject: deleting subdirectories only in Win32 > > Hello, > When trying to delete subdirectories and their files on > WinXP SP3, the following code also removes the root directory > of the subdirectories. Can I get some assistance? I want to > keep C:\my\data intact but I am losing the \data folder > > # > # Code to remove all files and subdirectories under C:\my\data > # > perl -e "use File::Path; rmtree('C:/my/data',{keep_root => 1, > safe => 1});" > > > > -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/