Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl+$ftp->message

Status
Not open for further replies.

himagauri

Programmer
Jun 29, 2006
10
US
Hi,

I'm running an automated FTP job using Perl script.
After each ftp command I have used $ftp->message command.

This helps me log only one message issued by FTP server.

for e.g: Here is a code snippet

$ftp->get(file1,file2);
$s = $ftp->message;
mylog($s);

FTP SERVER returns the following messages (as seen on the console):
RETR 'file1'
125 Sending data set file1
250 Transfer completed successfully.

My code snippet logs only the first message issued by the FTP server:
i.e. Sending data set file1
but not the second message:
i.e. Transfer completed successfully

How do I get all the messages issued by the FTP server after my code issues commands to FTP Server?

I would also like to retrieve the status code. Is there any other command in Perl similar to $ftp->message, which would retrieve the status code as well as message?

-Thanks,
Regards,
Himagauri
 
Hi,

I would also like to know how to capture the STDERR messages in a text file.
My Perl script is a daemon and uses fork().

-Thanks,
Regards,
Himagauri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top