Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by broomduster (Priest)
on Aug 27, 2008 at 19:28 UTC ( #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
Node Status?
node history
Node Type: note [id://707269]
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: (4)
As of 2020-11-28 10:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?