Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

•Re: Remove eMpTy Directories

by merlyn (Sage)
on Nov 18, 2002 at 21:57 UTC ( [id://213945]=note: print w/replies, xml ) Need Help??


in reply to Remove eMpTy Directories

Waaaaayy too much coding.
use File::Find; finddepth sub { return if $_ eq "." or $_ eq ".."; return unless -d; rmdir($_) or $! =~ /not empty/ or warn "Cannot rmdir $File::Find::na +me: $!"; }, @ARGV;

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re: •Re: Remove eMpTy Directories
by jdporter (Paladin) on Nov 19, 2002 at 16:17 UTC
      Quite inefficient. perl -MFile::Find -e 'find( { wanted => sub {}, postprocess => sub { rmdir $File::Find::name } }, @ARGV )'

      Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://213945]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-12-06 05:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (39 votes). Check out past polls.