Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^5: Optimizing files' moving with File::Find & File::Copy modules

by JavaFan (Canon)
on Nov 17, 2009 at 17:27 UTC ( [id://807746]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Optimizing files' moving with File::Find & File::Copy modules
in thread Optimizing files' moving with File::Find & File::Copy modules

Eh, no. <$dir1/*> doesn't distinguish between files and directories, it doesn't find files whose name start with a dot, and doesn't recurse into directories below $dir1. And if there are many files, you may run into system limits - most OSses have a limit on the number of arguments (and total size of the arguments) exec can take. (E2BIG).

Replies are listed 'Best First'.
Re^6: Optimizing files' moving with File::Find & File::Copy modules
by runrig (Abbot) on Nov 17, 2009 at 17:42 UTC
    So I simplified "finding" the files :-) (as you did in your first answer...and before I read the followup about needing a recursive find...and if a single level was adequate but you needed to filter directories, then a simple grep could take care of that...and if you really wanted files with leading dots, then add a ".*" pattern to the glob) You could use File::Find to push the files onto an array, then splice off N files at a time and use system to move the files.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-03-29 06:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found