Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Net SFTP Foreign rget

by salva (Abbot)
on Nov 27, 2013 at 09:04 UTC ( #1064583=note: print w/replies, xml ) Need Help??

in reply to Net SFTP Foreign rget

So, what do you get when you add $Net::SFTP::Foreign::debug=(~(8|16|1024|2048)) at the beginning of your script?

Do you known which OS and SSH server is running on the remote side?

Also, Net::SFTP::Foreign->new(...) returns always a true value. In order to check for errors, you have to call the error method afterwards (or the die_on_error shortcut) or alternatively use the autodie mode. In example:

my $sftp = Net::SFTP::Foreign->new(...); $sftp->die_on_error("Unable to connect to remote host");
or ...
my $sftp = Net::SFTP::Foreign->new(..., autodie => 1);

Replies are listed 'Best First'.
Re^2: Net SFTP Foreign rget
by SpaansBolletje (Initiate) on Nov 27, 2013 at 09:11 UTC
    It is running windows xp, and hosting a sftp server. When i check the debug log, i see that the files are not regular files? They are just text files or xml files.

    set_error: _set_err code: 35, str: remote file '/temp/sftp/01/01.txt' is not regular file, directory or link

    And thanks for the error tip!
      In order to discover vendor and version of the software use telnet to connect to the ssh port on the server and it will tell you. For instance, this is what I get from my workstation:
      $ telnet localhost 22 Trying ::1... Connected to localhost.localdomain. Escape character is '^]'. SSH-2.0-OpenSSH_6.2p2 Ubuntu-6ubuntu0.1

      Also, can you dump the result of calling stat on any of those files that fail to transfer:

      use Data::Dumper; Print Dumper($sftp->stat('/temp/sftp/01/01.txt'));

        Using FreeFTPd to create the sftp server

Re^2: Net SFTP Foreign rget
by SpaansBolletje (Initiate) on Nov 27, 2013 at 17:39 UTC
    I have created my own recursive function. So I have a working solution. Thanks
      Could you provide the information I have requested on my previous posts anyway so that I can fix any bug present on the rget method, please?

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2018-05-20 12:47 GMT
Find Nodes?
    Voting Booth?