llass61 has asked for the wisdom of the Perl Monks concerning the following question:
use Net::SSH2; my $host = 'ftp.???.com'; my $user = 'user'; my $password = 'password'; $ssh2 = Net::SSH2->new(); print "\nconnecting to $host...\n"; $ssh2->connect($host); print "\nauth to $host...\n"; $ssh2->auth_password($user,$password); print "\ngetting sftp hdl...\n"; my $sftp = $ssh2->sftp(); print "\nopening dir...\n"; my $dir = $sftp->opendir("test/out"); print "\nreading...\n"; while(my $item = $dir->read) { my $file = $item->{'name'}; my $mode = $item->{'mode'}; print "file = $file\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ssh2 open file problem
by llass61 (Novice) on Nov 05, 2008 at 16:36 UTC |