Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Should -f test return true for symlinks ?

by Utilitarian (Vicar)
on Oct 23, 2013 at 13:43 UTC ( #1059307=note: print w/ replies, xml ) Need Help??


in reply to Should -f test return true for symlinks ? [RESOLVED]

$ perl -e 'printf "File test: file %d f_link %d dir %d d_link %d\n" , +-f "file" , -f "f_link", -f "dir", -f "d_link"; ' File test: file 1 f_link 1 dir 0 d_link 0 $ perl -e 'printf "Dir test: file %d f_link %d dir %d d_link %d\n" ,- +d "file" , -d "f_link", -d "dir", -d "d_link"; ' Dir test: file 0 f_link 0 dir 1 d_link 1
So it would appear that the symlink is followed by the test ...

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."


Comment on Re: Should -f test return true for symlinks ?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-04 19:07 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 (60 votes), past polls