On 03/08/2013 07:47 PM, Chris Stinemetz wrote:
U
sing Net::FTP is there a way to rename a file after locating it and before
putting it?

For example:

  $ftp->put('/storage/pcmd/2013-03-08.17:21.-0700.MMEpcmd.gz') || die "can't
put file: $!";

Doesn't transfer correctly because the windows FTP server doesn't allow ":"
in the file name.

Any help is appreciated.

Thank you,

Chris

From the Net::FTP documentation:

put ( LOCAL_FILE [, REMOTE_FILE ] )

Put a file on the remote server. LOCAL_FILE may be a name or a filehandle. If LOCAL_FILE is a filehandle then REMOTE_FILE must be specified. If REMOTE_FILE is not specified then the file will be stored in the current directory with the same leafname as LOCAL_FILE.

Returns REMOTE_FILE, or the generated remote filename if REMOTE_FILE is not given.

NOTE: If for some reason the transfer does not complete and an error is returned then the contents that had been transferred will not be remove automatically.
put ( LOCAL_FILE [, REMOTE_FILE ] )

   Put a file on the remote server. |LOCAL_FILE| may be a name or a
   filehandle. If |LOCAL_FILE| is a filehandle then |REMOTE_FILE| must
   be specified. If |REMOTE_FILE| is not specified then the file will
   be stored in the current directory with the same leafname as
   |LOCAL_FILE|.

   Returns |REMOTE_FILE|, or the generated remote filename if
   |REMOTE_FILE| is not given.

   *NOTE*: If for some reason the transfer does not complete and an
   error is returned then the contents that had been transferred will
   not be remove automatically.


Reply via email to