Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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);


Comment on Re: Net SFTP Foreign rget
Select or Download Code
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'));
        SSH-2.0-WeOnlyDo-wodFTPD 3.2.2.395

        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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1064583]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2014-12-19 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (84 votes), past polls