Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: reading directories

by merlyn (Sage)
on Sep 15, 2001 at 05:45 UTC ( [id://112591]=note: print w/replies, xml ) Need Help??


in reply to Re: reading directories
in thread reading directories

opendir(DIR, "/users/foo/"); @bar = readdir(DIR); closedir(DIR); for (1..2) {shift @bar;} #get rid of '.' and '..'
There is no promise that the first two elements returned from a readdir are dot and dotdot, so this code is dangerously unportable. It might not even work on your own machine tomorrow.

-- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-25 07:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found