Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Flattening a directory tree in a filesystem

by atcroft (Abbot)
on Jan 28, 2014 at 05:04 UTC ( [id://1072314]=note: print w/replies, xml ) Need Help??


in reply to Flattening a directory tree in a filesystem

As you mentioned, File::Find to search for files, File::Spec to handle dealing with paths (or possibly File::Basename to separate the path and file name), and File::Copy to move the files. (I thought about suggesting Parallel::ForkManager and spawning off multiple children to do the copying, but realized you would likely not see a performance improvement as a result.)

Regarding collisions, I would suggest scanning for files in a pass, then do all of the file moves in a second loop.

Hope that helps.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-03-28 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found