Path: csiph.com!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'rename': 0.07; 'subject:file': 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; 'yeah,': 0.09; 'suggest': 0.11; '07:50,': 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; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'renames': 0.16; 'suppport': 0.16; 'windows': 0.19; 'file.': 0.20; 'exists.': 0.22; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; "doesn't": 0.28; 'header:X-Complaints-To:1': 0.28; 'code': 0.31; 'implement': 0.32; 'file': 0.32; 'could': 0.32; 'problem': 0.33; 'to:addr:python-list': 0.33; 'there': 0.35; 'add': 0.36; 'received:org': 0.36; 'two': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'side': 0.61; 'between': 0.63; 'different': 0.63; 'subject:status': 0.84; 'approach.': 0.91; 'suffer': 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: Mon, 09 Jul 2012 10:17:52 +0200 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: f048046007.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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341821896 news.xs4all.nl 6867 [2001:888:2000:d::a6]:57800 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25071 Am 09.07.2012 07:50, schrieb Plumo: >> Windows doesn't suppport atomic renames if the right side exists. I >> suggest that you implement two code paths: > > Problem is if the process is stopped between unlink and rename there > would no status file. Yeah, you have to suffer all of Windows' design flaws. You could add a backup status file or use a completely different approach.