Search notes:

Perl module Net::SFTP::Foreign

use warnings;
use strict;

use Net::SFTP::Foreign;

my $host     = shift;
my $username = shift;
my $password = shift;
my $path     = shift;

my $sftp = Net::SFTP::Foreign->new(
    host     =>  $host,
    user     =>  $username,
    password =>  $password,
#   ssh_cmd  => "$ENV{USERPROFILE}/tools/WinSCP.com"
    ssh_cmd  => 'plink'
);

$sftp->die_on_error("Unable to establish SFTP connection");

$sftp->setcwd($path, 
    check => 0  # Is this needed because I am connecting to a Windows server?
) or die "unable to change cwd: " . $sftp->error;

my $ls =  $sftp->ls; # ($path);

for my $e (@$ls) {
  printf "%-30s | %-90s | %-6s\n",
    $e->{filename},
    $e->{longname},
    $e->{a}->size || 'n/a'
   ;
}

# $sftp->get("foo", "bar") or die "get failed: " . $sftp->error;

# $sftp->put("bar", "baz") or die "put failed: " . $sftp->error;
Github repository PerlModules, path: /Net/SFTP/Foreign/script.pl
Perl modules.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759391189, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Perl/modules/Net/SFTP/Foreign/index(72): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78