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

Re: How do I copy an empty directory?

by pvaldes (Chaplain)
on Oct 03, 2012 at 08:33 UTC ( #997007=note: print w/ replies, xml ) Need Help??


in reply to How do I copy an empty directory?

#!/usr/bin/perl use File::Find; finddepth (\&empdir, ($ARGV[0] || '.')); sub empdir { return unless -d && rmdir($_); mkdir "/tmp/$_"; }

Works for me in GNU. Any "empty" directory having only empty subdirectories will be deleted also (as the empty subdirs). Adapt the line 7 to your needs


Comment on Re: How do I copy an empty directory?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2015-07-04 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls