Return values from $ftp->put 
Author Message
 Return values from $ftp->put

Hi, I need to fetch the control data from a $ftp->put ($file1,$file2)
operation.

Example output from using FTP from the command line
ftp>put test
200 PORT command successful.
150 ASCII data connection for test
226 JOB = 7763243 - Transfer complete (68 bytes rcvd).
etc.

I whish to catch the JOB id given from the other server (7763243). I will
use this value as an acknowlede in my Perl script and later use it to check
something. I have no control over the configuration of the another server.

I'm using - Net::FTP;

$return_value = $ftp->put will only give me the filename that was
transferred ok.

Any one?



Fri, 07 Feb 2003 03:00:00 GMT  
 Return values from $ftp->put

[mailed and posted]

Quote:
> 226 JOB = 7763243 - Transfer complete (68 bytes rcvd).

> I whish to catch the JOB id given from the other server (7763243).
> I'm using - Net::FTP;

The manual says that Net::FTP inherits from Net::Cmd, and I see that
Net::Cmd provides a ->message method.  Maybe

        $message = $ftp->message

or some other Net::Cmd methopd will do what you want.



Sat, 08 Feb 2003 03:00:00 GMT  
 Return values from $ftp->put

Quote:

> ftp>put test
> 200 PORT command successful.
> 150 ASCII data connection for test
> 226 JOB = 7763243 - Transfer complete (68 bytes rcvd).
> I whish to catch the JOB id given from the other server (7763243).
> $return_value = $ftp->put will only give me the filename that was
> transferred ok.

my ($jobid) = $ftp->message() =~ /JOB = (\d+)/;

Note: Reading documentation is a good start, but sometimes it pays to
read the source too.

--
     \\   ( )
  .  _\\__[oo

 .  l___\\
  # ll  l\\
 ###LL  LL\\



Sat, 08 Feb 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. SQLCA from informix DB, Sorry !!

2. $ftp->put stores empty file (Net::FTP)

3. Help: system() returns odd values after normal >>= 8

4. Net::Ftp->mdtm() returns empty

5. Object inspector vs. coded in Delphi editor problem

6. <SELECT multiple...> only returns 1st value

7. $arrayref->[0..2] returns first value in array only

8. Strange return values for $widget->rgb

9. HList->yview() return value

10. Can't get size value back when using $ftp->size

11. win32 ftp'put problem with ftp.pl

 

 
Powered by phpBB® Forum Software