Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 ?

Replies are listed 'Best First'.
Re^3: Optimizing performance for script to traverse on filesystem
by GrandFather (Sage) 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?
[Lady_Aleena]: This evening, I thought to myself, "I would love to search Netflix for 100 randomfilms from my database to see if they have them." So I went to CPAN to see if there were a modiule which could do such a thing. There is, but GUH! ...
[Lady_Aleena]: ... Does it have to be that hard and complex to use to do a search on Netflix?
Lady_Aleena grumbles.

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2017-01-21 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (180 votes). Check out past polls.