Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: greater efficiency required (ls, glob, or readdir?)

by broomduster (Priest)
on Aug 27, 2008 at 19:28 UTC ( [id://707269]=note: print w/replies, xml ) Need Help??


in reply to greater efficiency required (ls, glob, or readdir?)

If the directory is large and you want to do globbing of file names, then ls can be a bad idea. From the shell:

-> ls | wc -l 61498 -> ls * bash: /bin/ls: Arg list too long
You wouldn't actually do this to get the full directory listing, of course, but if the list of something*.whatever files that you want is too long, you're still hosed. In that case, you want a readdir / grep combo or glob (which doesn't suffer the same limitation as ls).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-25 23:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found