Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Net:FTP Not overwrite files

by alexm (Chaplain)
on Jul 26, 2008 at 19:26 UTC ( [id://700311]=note: print w/replies, xml ) Need Help??


in reply to Re: Net:FTP Not overwrite files
in thread Net:FTP Not overwrite files

Net-FTP-File has also the exists() method, which would be more appropiate because if the filename exists and is actually a directory the file put through FTP would be created under that directory, which doesn't seem to be the OP's desired behaviour.

Replies are listed 'Best First'.
Net:FTP Not overwrite files
by lightman (Initiate) on Jul 24, 2009 at 14:14 UTC
    Hi i developed a very simples way to accomplish that it is so simple and work with the old Net::FTP
    $ftp->put("$file") unless $ftp->rename("$file","$file");
    well gonna put file only if it doens't exits otherwise it will rename it with the same actual name! it is genious regards Claudio
      that's a good idea, but mdtm() or size() can be better. because rename() changes its property. mdtm() and size() changes nothing.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found