Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: read_dir issue

by zork42 (Monk)
on Aug 26, 2013 at 07:59 UTC ( #1050915=note: print w/replies, xml ) Need Help??


in reply to read_dir issue

BUG: folders can contain things other than files and folders.
I'm pretty sure this is true even in Windows.
eg when I do dir C:\Users, I see <DIR>s, but also <SYMLINKD>s and <JUNCTION>s (Windows Vista)
See file test ops

So you might want to change lines 16-27 in your OP, as indicated by ##### in the following:
for my $file (@files) { print $file; if(-f $file) { print " is a file.\n"; } #else ##### elsif (-d _) ##### { print " is a dir.\n"; } else ##### { ##### print " is something else.\n"; ##### } ##### }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1050915]
help
Chatterbox?
[LanX]: good morning
[choroba]: LanX good indeed
[choroba]: very cloudy here, I planned to make some picrures, but now I don't think so
[LanX]: do you like it better now?
[choroba]: Well, getting used to it
[LanX]: several people told me they like saigon. ..
[choroba]: well, beer is good here, surprisingly
[choroba]: also, I discovered several vegan/vegetarian restaurants, so I can avoid meat
[LanX]: ha ha ... happy Czech :)
[choroba]: been to the War Remnants Museum, too. Quite a brutal experience

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2017-02-26 04:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (371 votes). Check out past polls.