Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: File Rename

by Rich36 (Chaplain)
on Nov 28, 2001 at 23:25 UTC ( [id://128147]=note: print w/replies, xml ) Need Help??


in reply to File Rename

Since I don't know whether or not you have control over the application that is doing the FTP or not, this may or may not be valid...
But if you are coding the ftp portion of the application, you could change the file name during the transfer instead of after the fact.
An example using Net::FTP...
use Net::FTP; my $mytime = localtime; my $file = "filea" # Set up the FTP my $ftp = new Net::FTP; $ftp->login('name', 'password'); # If you're putting the file somewhere... $ftp->put($file, "$file$mytime"); # Or if you're getting the file from somewhere... $ftp->get($file, "$file$mytime"); $ftp->close();
Net::FTP allows you to specify a new name and location for a file when you are getting or putting a file - I would assume other FTP methods/modules would do the same.
Rich36
There's more than one way to screw it up...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://128147]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-25 06:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found