Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Should -f test return true for symlinks ?

by toolic (Bishop)
on Oct 23, 2013 at 13:39 UTC ( #1059306=note: print w/replies, xml ) Need Help??


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

I agree that the Perl document does not explicitly state the behavior in this case. But, you could test if it is both a file and a link:
$ perl -e 'printf "%d%d%d%d%d\n", -f "file", -f "link", -l "file", -l +"link", -f "link" and -l "link"' 11011

Caution: I haven't tested all the combos of files/dirs/links, etc.

Replies are listed 'Best First'.
Re^2: Should -f test return true for symlinks ?
by Bloodnok (Vicar) on Oct 23, 2013 at 14:13 UTC
    Indeed I could;-/

    I'll also raise a defect against the file test operator document to make plain the fact that the link is followed and suggest another use case when trying to determine a truly plain file.

    A user level that continues to overstate my experience :-))

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2020-11-30 12:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?