Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Optimizing performance for script to traverse on filesystem

by gdanenb (Acolyte)
on Feb 02, 2012 at 06:37 UTC ( #951367=note: print w/ replies, xml ) Need Help??


in reply to Re: Optimizing performance for script to traverse on filesystem
in thread Optimizing performance for script to traverse on filesystem

If I use

while ( my $name = readdir( DIR )) { ... }
I have to leave DIR opened while walking deeper in recursive
Only when all directories on the level are scaned, I can closedir(DIR)
Isn't it problematic ?


Comment on Re^2: Optimizing performance for script to traverse on filesystem
Download Code
Re^3: Optimizing performance for script to traverse on filesystem
by GrandFather (Cardinal) on Feb 02, 2012 at 22:19 UTC

    Is the structure likely to be more than a few tens of directories deep? If not, no problem. If it is then you'll have to work really hard to fix the problem regardless of what tools you use because most simple solutions will keep directory handles open.

    True laziness is hard work

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-12-28 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (178 votes), past polls