Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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"; ##### } ##### }


Comment on Re: read_dir issue
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2015-07-31 07:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (275 votes), past polls