Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How do I test whether a file has some contents or not?

by ybiC (Prior)
on Oct 15, 2000 at 17:13 UTC ( #36810=note: print w/replies, xml ) Need Help??


in reply to How do I test whether a file has some contents or not?

Filetest operators can be found at perlfunc:_X.   Just a day or so ago swiftone showed me the "_" shortcut for performing multiple tests on one file.   Yet another way to look at it.
if (-s $file && -T _) { # do stuff with text file > 0bytes } if (-s $file && -B _) { # do stuff with binary file > 0bytes }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2021-12-06 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (31 votes). Check out past polls.

    Notices?