Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: -s testing for empty file; works on local, but not on remote

by Jeri (Scribe)
on Sep 27, 2011 at 19:03 UTC ( #928147=note: print w/ replies, xml ) Need Help??


in reply to Re^3: -s testing for empty file; works on local, but not on remote
in thread -s testing for empty file; works on local, but not on remote

What exactly do you mean by 'error'? if the -s/-z can't figure if the file has anything in it or not?


Comment on Re^4: -s testing for empty file; works on local, but not on remote
Re^5: -s testing for empty file; works on local, but not on remote
by ikegami (Pope) on Sep 27, 2011 at 19:06 UTC

    stat can fail for a number of reasons.

    Add the following before the if (-s) line:

    use Data::Dumper; print(Dumper(-s "/home/vcg/Documents/Trial/temp")); print(Dumper("$!"));

    What's the output?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2014-09-21 22:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls