Re: [Ssh-sftp-perl-users] Determining sftp failure?
Brought to you by:
dbrobins
|
From: Dave R. <au...@ur...> - 2004-02-02 02:49:05
|
On Sun, 1 Feb 2004, Mark Fuller wrote:
> I've decided to use this to determine if errors occured:
>
> ====================================
> my @warnings;
>
> $SIG{'__WARN__'} = sub { $warnings[$#warnings + 1] = $_[0]; };
> eval {$pwd = $sftp->do_realpath(".");};
> $SIG{'__WARN__'} = 'DEFAULT';
>
> if ($#warnings > -1 or (!defined($pwd) or $pwd eq '') ) {
> # treat it as an error, display each row of @array
> }
> ====================================
>
> That might be a bad example. It seems like all the "do_" methods reliably
> return something indicating a bad execution. Where I have difficulty is with
> "get" or "put". I can't tell how to detect a failure without capturing
> warnings and checking them.
This is probably the only way to do this right now.
> If anyone knows a better way, I'd like to know about it. I was hoping for a
> method like Net::FTP's "object->message" or a positive or negative return
> from get/put.
Yeah, I need to look through the code and find a comprehensive error
return solution for all the public methods.
-dave
/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/
|