Tuesday, May 16, 2006, 12:44:00 PM, you wrote:
BN> I have not found the build to be stable IMHO.  On Unix, it works great.
BN> I use the secure dev kit with WS_FTP.  It costs a few bucks but it is
BN> stable and object oriented which give you a lot of flexibility.
BN>
BN> Let me know if you get it working.  Since my needs are for work I did
BN> not feel comfortable relying upon it...
BN> Nick

RWS> From: [EMAIL PROTECTED]
RWS> [mailto:[EMAIL PROTECTED] On Behalf Of
RWS> [EMAIL PROTECTED]
RWS> Sent: Tuesday, May 16, 2006 8:45 AM
RWS> To: perl-win32-users@listserv.ActiveState.com
RWS> Subject: Does NET::SFTP work on Win32?
RWS>
RWS> Hi all,
RWS>
RWS> I have a perl ftp client that connects to IIS and I need to update the
RWS> client to use a secure means of transfer to a SSH/SSL server. All I need
RWS> to do is open, login, send, get, and size for files on a remote box. I
RWS> have net::sftp and net::ssh::win32 and other associated modules (5.6.1
RWS> from Soulcage.net) but there is also a lot of discussion on NG/lists
BN> about it not working with Win32. I can change to perl 5.8 if necessary.
BN> Can somebody give me a heads up if the ssh::Win32 module won't do the
BN> job? Or if there is another way? Any hints for success would also be
BN> appreciated. Thanks in advance.

<snip />

BN> I have not found the build to be stable IMHO.  On Unix, it works great.
BN> Let me know if you get it working.  Since my needs are for work I did
BN> not feel comfortable relying upon it...

I use Net::SFTP on Win2K and XP with no issues.

Try here:

http://www.soulcage.net/ppds/
(Thanks, Rob!)

RWS> to do is open, login, send, get, and size for files on a remote box. I

Here is an example:

use strict;
use warnings;

# these are the variables for SFTP
my $hostname  = 'HOSTNAME';
my %sftp_args = (user            => 'USERNAME',
                 password        => 'PASSWORD',
                 identity_files  => '/directory/to/indentities',
                 debug           => 1);

# note: directory needs an ending slash
my %params    = (local_directory  => 'c:/local/directory/',
                 remote_directory => '/remote/directory/'
                 file_extension   => 'ack');

my $sftp      = Net::SFTP->new($hostname, %sftp_args)
                       or die "Cannot connect to Host: [EMAIL PROTECTED]";

print "CONNECTED\n";
          
my @listings  = $sftp->ls($params{remote_directory});

print "LISTINGS\n";

foreach (@listings) {
          
   my $listings = $_;
   my $filename = $listings->{filename};

   # skip if not right file extension
   next if ($filename !~ /\.$params{file_extension}$/i);

   my $local_filepath = "$params{local_directory}$filename";
   my $remote_filepath = "$params{remote_directory}$filename";

   print "DO SOMETHING WITH: $filename\n";
   
   # send
   # uncomment to: send local file to remote server
   # $sftp->put($local_filepath, $remote_filepath);

   # get/receive
   # uncomment to: retrieve remote file from server to local file
   # $sftp->get($remote_filepath, $local_filepath);

}

print "Done\n";


-- 
Best regards,
 Christopher                            mailto:[EMAIL PROTECTED]

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to