Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^5: A DWIM too far?

by mpeppler (Vicar)
on Jun 18, 2004 at 14:07 UTC ( [id://367950]=note: print w/replies, xml ) Need Help??


in reply to Re^4: A DWIM too far?
in thread A DWIM too far?

Personally I would prefer rename to fail by default with an option to overwrite. It would make my code more robust.
You'd still get the race condition, unless the underlying C API call was atomic - and we've seen that in a lot of cases this isn't the case (i.e. you'd first have to check for the file's existence, hence the race condition.)

Michael

Replies are listed 'Best First'.
Re^6: A DWIM too far?
by adrianh (Chancellor) on Jun 18, 2004 at 14:14 UTC
    You'd still get the race condition, unless the underlying C API call was atomic

    I'd hoped that it would have been obvious that this would need to be implemented without using rename(2) :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found