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.