Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

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


in reply to Re: -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

I'm not exactly certain, but when I started using -z, the remote program began catching my empty files like the local one.
  • Comment on Re^2: -s testing for empty file; works on local, but not on remote

Replies are listed 'Best First'.
Re^3: -s testing for empty file; works on local, but not on remote
by ikegami (Pope) on Sep 27, 2011 at 18:58 UTC

    There is one difference:

    If you don't check for errors, errors (incl non-existent files) being returned by -s will be mistaken as empty file.

    If you don't check for errors, errors (incl non-existent files) being returned by -z will be mistaken as non-empty file.

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

        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?

      I see your point. Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://928144]
help
Chatterbox?
[marto]: it does literally nothing, solves no problems that aren't already addressed, but it's real easy to mine, because nobody is doing it
[LanX]: cb60.datenzoo.de is producing broken links for me ...
erix foresees fungibility problems ;)
erix goes afk - catch y'all later
[Corion]: LanX: Broken links in what sense?
[Discipulus]: neurocent goes always up with the same curve of population raise
[marto]: believe in derp coin
[Corion]: Oh - I see ...
[LanX]: like http://cb60. datenzoo.de/:// perlmonks.org/ index.pl?node_id= 1215217
[Discipulus]: username links i bet

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2018-05-25 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?