in reply to net-sftp-foreign transfer failed vs file not present.
You can also check the last status response from the server ($sftp->status). For conforming serves, that should be SSH2_FX_NO_SUCH_FILE.
In summary:
use Net::SFTP::Foreign::Constants qw(:error :status); ... unless ($sftp->get($remote, $local)) { if (($sftp->error == SFTP_ERR_REMOTE_STAT_FAILED or $sftp->error == SFTP_ERR_REMOTE_OPEN_FAILED) and $sftp->status == SSH2_FX_NO_SUCH_FILE) { say "Remote file does not exist!"; } else { say "Transfer failed"; } die $sftp->error; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: net-sftp-foreign transfer failed vs file not present.
by mariog (Acolyte) on Aug 07, 2014 at 09:47 UTC | |
by McA (Priest) on Aug 07, 2014 at 11:44 UTC | |
by mariog (Acolyte) on Aug 07, 2014 at 13:40 UTC | |
by McA (Priest) on Aug 07, 2014 at 14:14 UTC |