Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: directory or file?

by pfaut (Priest)
on Apr 16, 2003 at 13:08 UTC ( [id://250884]=note: print w/replies, xml ) Need Help??


in reply to directory or file?

Use the filetest operators which are described in perldoc perlfunc. -f FH or -f "filename" returns true for a normal file. -d "filename" returns true for a directory. There are many others that return various pieces of information about the specified file.

90% of every Perl application is already written.
dragonchild

Replies are listed 'Best First'.
Re: Re: directory or file?
by Fletch (Bishop) on Apr 16, 2003 at 13:39 UTC

    perldoc -f -X will bring up the specific entry from perlfunc on the test operators. See also perldoc -f stat, or perldoc File::stat for the OOPy in the audience.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-26 00:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found