Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Net::SFTP does not catch errors

by idsfa (Vicar)
on Oct 01, 2003 at 03:12 UTC ( #295503=note: print w/replies, xml ) Need Help??


in reply to Net::SFTP does not catch errors

Yup, put() sure doesn't return a status. The pod nods in the direction of saying so, by not indicating any return value. The code confirms this, with no return values for the put function. The lower level commands such as do_write, however, do return a status. You may need to roll your own ...

$sfh = $sftp->do_open($target_file ...); . . . #loop over source file, reading blocks of $data $status = $sftp->do_write($sfh, $offset, $data) &bail_out($status) if ($status != SSH2_FX_OK); . . . $sftp->do_close($sfh);

In fact, this is pretty much exactly what the put() method does, but it discards the $status. Might have a patch to submit there ...


Remember, when you stare long into the abyss, you could have been home eating ice cream.

Replies are listed 'Best First'.
Re: Re: Net::SFTP does not catch errors
by mikedshelton (Beadle) on Dec 21, 2003 at 03:26 UTC
    bug reports submitted

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://295503]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2018-07-20 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (424 votes). Check out past polls.

    Notices?