Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Net:FTP Not overwrite files

by spivey49 (Monk)
on Jul 25, 2008 at 18:20 UTC ( #700198=note: print w/replies, xml ) Need Help??


in reply to Net:FTP Not overwrite files

How about uploading the file to a temp name? After the temp file is done check to see if the real file is there. If it is do something with the temp file like delete it, or rename it to the real file name if it's not there. That "should" handle the race condition. Of course, on a busy server you might still run into issues there.

If you're looking for a way to determine whether the file exists or not you could eval a $ftp->get for the file or query the output of a $ftp->dir.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2019-12-11 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?