You will find that the system call will return an integer depending on
success or failure I believe.

Try somthing like this 

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

You would have to check the return values though.

Hope this helps

Martin Wheldon
Senior Technical Consultant 
Leeds Learning Network
Tel: 0113-214-4441
E-mail: [EMAIL PROTECTED]


The information in this email (and any attachments) may be for the intended
recipient only.If you know you are not the intended recipient, please do not
use or disclose the information in any way and please delete this email (
and any attachment) from your system.



-----Original Message-----
From: Glenn Meyer [mailto:[EMAIL PROTECTED]]
Sent: 08 April 2002 19:31
To: [EMAIL PROTECTED]
Subject: System("ftp


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