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

Re: Re: When is it safe to move a file?

by BoredByPolitics (Scribe)
on Jan 14, 2001 at 19:00 UTC ( #51744=note: print w/replies, xml ) Need Help??

in reply to Re: When is it safe to move a file?
in thread When is it safe to move a file?

Thanks repson - I'll give that a go and see how I get on :-)


  • Comment on Re: Re: When is it safe to move a file?

Replies are listed 'Best First'.
Re: When is it safe to move a file?
by Dominus (Parson) on Jan 14, 2001 at 22:23 UTC
    I'd strongly recomment that you follow kschwab's advice and rename the data file to the same directory before you start to copy or process it. Copying takes time, and you don't want the remote process to start updating the file while your process in in the middle of copying it. Renaming it first will help prevent that.

    Then, after you rename it, check to see if it's still changing, because it's possible that the remote process opened the file just before you renamed it.

    There's still a race condition, but it's much smaller. Proper design would have been for the remote program to never send the same data twice and never use the same filename twice. I also recommend that you find the person who designed this broken protocol and kick them in the ass.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2022-01-28 05:48 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (73 votes). Check out past polls.