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"; }
In reply to ssh2 open file problem by llass61
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |