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

Replies are listed 'Best First'.
Re^5: -s testing for empty file; works on local, but not on remote
by ikegami (Patriarch) 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?