[Ssh-sftp-perl-users] Using scp_get
Brought to you by:
dbrobins
From: J <mer...@ya...> - 2006-02-24 15:33:37
|
I just started using Net::SSH2 and I can connect to a remote directory and list the files in that directory. scp_get hangs and does not copy anything. --- snip ---> $ssh2 = Net::SSH2->new(); $ssh2->connect("servername"); if ($ssh2->auth_publickey(...)) { my $sftp = $ssh2->sftp; my $dir = '/remote dir/'; my $directory = $sftp->opendir($dir); while (my $item = $directory->read) { print "$item->{name}\n"; if ($item->{name} eq "test1.txt") { if ($ssh2->scp_get('remote dir/test1.txt', '/current dir/test1.txt')) { print"done"; } else { print "not done"; } } } } $ssh2->disconnect(); <--- end --- __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |