An alternative strategy would be to use the Net::FTP module to do your FTP
operations.  This would have the benefit of capturing any errors, example:

my $Hostname = "foo";

unless ($Ftp = Net::FTP->new($Hostname, Debug => 0)) {
    print "Error opening connection to $Hostname: $!";
  }

You could also programmatically insert retry conditions, although this
would probably require a redesign of your current application.


Phil Morley



                                                                                       
                             
                    "Glenn Meyer" <[EMAIL PROTECTED]>                                 
                             
                    Sent by:                                     To:     
[EMAIL PROTECTED]  
                    [EMAIL PROTECTED]        cc:                   
                             
                    eState.com                                   Subject:     
System("ftp                           
                                                                                       
                             
                                                                                       
                             
                    08/04/02 19:30                                                     
                             
                                                                                       
                             
                                                                                       
                             



I am using the following subroutine to ftp log files to a central log
server.

my $ftphost = "10.xx.xx.xxx";
my $ftpuser = "weblog";
my $ftppasswd = "weblog";

&ftpzips($ftphost,$ftpuser,$ftppasswd);

sub ftpzips {
      open(FTPCOMMANDS, ">ftp_commands.txt");
      print FTPCOMMANDS "user $_[1] $_[2]\nbin\nprompt\nmput *.zip\nbye\n";
      close(FTPCOMMANDS);

      system("ftp -n $_[0] < ftp_commands.txt");
}


This is working well right now, but I need to add in some error checking
and/or retry feature.  Problem, I cannot add other packages to these boxes
- I must use built in Perl functions and operators.  These are NT4 servers
with ActiveState Perl 5.6.0.

Any thoughts as to how I can get either confirmation that the FTP was
successful or that it failed?  Thank you!!

Glenn Meyer


_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs





_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to