Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^3: Fastest way to recurse through VERY LARGE directory tree

by eff_i_g (Curate)
on Jan 21, 2011 at 17:14 UTC ( #883575=note: print w/replies, xml ) Need Help??

in reply to Re^2: Fastest way to recurse through VERY LARGE directory tree
in thread Fastest way to recurse through VERY LARGE directory tree


I don't follow you. File::Find::Rule does not simply return every file (although it can). You can instruct it what to return based on type, size, name, and even make a determination via a custom sub. You can have the sub perform actions and ignore the larger return value, or iterate with the start and match methods.

Replies are listed 'Best First'.
Re^4: Fastest way to recurse through VERY LARGE directory tree
by runrig (Abbot) on Jan 21, 2011 at 17:24 UTC
    Read the OP. I didn't say FFR has to return the entire list, the OP says the entire list needs to be processed. So, in this case, FFR would return the entire list of files.
      Ah, gotcha. But you can work around building the entire list:
      use warnings; use strict; use File::Find::Rule; File::Find::Rule->file->exec( sub { print $_[2], "\n"; return 0; } )->in('/path');

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://883575]
[marto]: I think that actually caught up with me yesterday, felt a really sharp pain where my neck meets my skull.
[Corion]: marto: Ouch, yeah...
[marto]: the boys uncle will take them for a couple of hours this afternoon :)
[marto]: only at work 3 days this week, then off to Copenhagen for a wedding
[marto]: back the following Monday, potentially gone 2-3 days the next week for work
[Corion]: Oh - "Cyber Monday" week is coming up... That's why weird stuff is already discounted now...
[Corion]: marto: Oh, cool, I hope you get to enjoy the trip and Copenhagen! I found it nice (but the mermaid is underwhelming)
[marto]: the kids and their mother are coming too, actually only 9 people at the wedding in total. Still, will be fun

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2017-11-19 11:38 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (280 votes). Check out past polls.