STINNER Victor <victor.stin...@haypocalc.com> added the comment: @pitrou: Yes, as I wrote: it's not possible to write an atomic function for all OS. The documentation must give a list of the OS on which the function is atomic. Would you prefer to not define the function instead of writing a pseudo-atomic function?
-- Java bug opened in 1996, closed with "Will Not Fix", last comment ("i am facing similar issue...") in 2008: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4017593 "How to do atomic writes in a file" in a MSDN blog: http://blogs.msdn.com/b/adioltean/archive/2005/12/28/507866.aspx Extract: "Sometimes shell operations like Delete, Rename can fail for various reasons. For example, it might just happen that an antivirus or content indexing application randomly scans the whole file system once in a while. So, potentially, the file Foo.Tmp.txt will be opened for a short period which will cause ... failed delete. And, not only that, but also Rename can fail if the old file already exists, and someone has an open handle on it." To avoid that "antivirus or content indexing application" open the file, we may need to use a lock on the files. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8828> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com