[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Sheflug] Weird happenings with PERL script and cron



> Even if this can't happen, it would be appropriately paranoid to check
> the return values on all the system calls.

It's quite hard to get return statuses (statii ??) from system("...")
calls. A different approach would be to check for non-zeroness, eg

system('rcp .... foo');
die "Copied file 'foo' is non-existent/zero-length!!\n" unless -s 'foo';

Of course, this wont detect a partially truncated file.

[ But what has any of this got to do with Linux... ;-)  ]

Dave.

---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.