I am experiencing intermittent hangs (resulting if FTP timeouts) when
running  a system script on a 
Solaris box that creates an FTP connection to a remote NT server. Below is a
simple script that was 
written to test the problem with the FTP connection on the system script.

All this script does is create an FTP connection, log-on and then toggle
between two remote dirs
and prints the filenames found... and it still experiences the hangs.


Any input would be appreciated.

use Net::FTP;
use strict;

my ($ftp, $path1, $path2);


#Create a FTP handle object
$ftp = Net::FTP->new('***.***.***.***', Timeout => 500) || die "WARNING!
Could not create FTP handle";
#Connect to FTP server  
$ftp->login('usrname', 'passwd') || print "[main] FTP returned an error
$!\n";
#change transfer type to binary to get correct file sizes
$ftp->binary; 

$path1 = "//delta/import/reports/csvreports/testing";
$path2 = "//delta/import/reports/csvreports/testing2";

$ftp->cwd($path1);
print $ftp->pwd()."\n";

while (1) {
        printStuff($path1);
        printStuff($path2);
        sleep(1);
}


sub printStuff{
        my $path = shift;
        my @files;
        my $temp;
        
        $ftp->cwd($path);
        print "Currently serarching directory $path\n";
        @files = $ftp->ls();

        foreach $temp (@files) {
                print "$temp\n";
        }
} 


**********************************************************************
This e-mail may be confidential and only the intended
recipient may access or use it.  If you are not the intended
recipient, please delete this e-mail and notify the sender
immediately.

The contents of this e-mail are the writer's opinion and are 
not necessarily endorsed by Delta Electricity unless
expressly stated.

We use virus scanning software but exclude all liability for
viruses or similar in any attachment.
**********************************************************************
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users

Reply via email to