Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'rename': 0.07; 'subject:file': 0.07; 'url:msdn': 0.07; 'subject:How': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'atomic.': 0.16; 'bugs.': 0.16; 'from:addr:cheimes.de': 0.16; 'from:addr:lists': 0.16; 'from:name:christian heimes': 0.16; 'message-id:@dough.gmane.org': 0.16; 'op.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'url:85)': 0.16; 'url:linux': 0.16; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; "doesn't": 0.28; 'header:X -Complaints-To:1': 0.28; 'actual': 0.28; 'file': 0.32; 'to:addr :python-list': 0.33; 'christian': 0.34; 'wrong': 0.34; 'server': 0.35; 'received:org': 0.36; 'but': 0.36; 'url:library': 0.36; 'subject:: ': 0.38; 'some': 0.38; 'page': 0.38; 'to:addr:python.org': 0.39; 'url:microsoft': 0.39; 'header:Received:5': 0.40; 'john': 0.60; 'url:aspx': 0.60; 'success': 0.63; 'url:en-us': 0.65; 'url:%1': 0.68; 'nfs': 0.84; 'subject:status': 0.84; 'win32:': 0.84; 'approach.': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Christian Heimes Subject: Re: How to safely maintain a status file Date: Tue, 10 Jul 2012 01:41:44 +0200 References: <4FF9F454.40207@shopzeus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: f049231185.adsl.alicedsl.de User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341877336 news.xs4all.nl 6969 [2001:888:2000:d::a6]:34970 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25109 Am 09.07.2012 22:24, schrieb John Nagle: > Rename on some file system types (particularly NFS) may not be atomic. The actual operation is always atomic but the NFS server may not notify you about success or failure atomically. See http://linux.die.net/man/2/rename, section BUGS. > That's because you're using the wrong approach. See how to use > ReplaceFile under Win32: > > http://msdn.microsoft.com/en-us/library/aa365512%28VS.85%29.aspx The page doesn't say that ReplaceFile is an atomic op. Christian