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

Re: Subtleties of files and directories

by SparkeyG (Curate)
on Mar 23, 2001 at 01:48 UTC ( #66474=note: print w/ replies, xml ) Need Help??


in reply to Subtleties of files and directories

While I'm not completly sure, the line  print "$dir exists" if ( -e $dir ); should work on all platforms. This is because of perl's unix roots, (gosh are those still showing :)
In unix, anything within the filesystem is a file, it just depends if it s a file file, a directory file, a socket file, etc. etc.

On your second question, a quick read through  perldoc File::Path leads me to beleive that your code will not work. And further read through the code, perldoc -m File::Path, leads me to believe the opposite, see Tye's post.

--SparkeyG

--Update: Corrected after reading Tye's post and further investigating the code.


Comment on Re: Subtleties of files and directories
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://66474]
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: (8)
As of 2015-07-28 09:00 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 (254 votes), past polls