Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.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.028 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'cc:addr:python-list': 0.11; '"0"': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message- id:@cskk.homeip.net': 0.16; 'nfs,': 0.16; 'nfs.': 0.16; 'received:211.29': 0.16; 'received:211.29.132': 0.16; 'received:optusnet.com.au': 0.16; 'received:syd.optusnet.com.au': 0.16; 'simpson': 0.16; 'write,': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'creating': 0.23; 'header:User- Agent:1': 0.23; 'greg': 0.24; 'cheers,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'thus': 0.29; 'unix': 0.29; "d'aprano": 0.31; 'steven': 0.31; 'yourself.': 0.31; 'file': 0.32; 'open': 0.33; 'skip:_ 10': 0.34; 'but': 0.35; 'there': 0.35; 'received:com.au': 0.36; 'method': 0.36; 'charset:us-ascii': 0.36; 'received:211': 0.38; 'fact': 0.38; 'expect': 0.39; 'even': 0.60; 'everybody': 0.60; 'content- disposition:inline': 0.62; "you've": 0.63; 'making': 0.63; 'today': 0.64; 'lack': 0.78; 'joan': 0.84; 'lightweight': 0.84; 'subject:skip:o 10': 0.84 Date: Thu, 9 May 2013 18:23:31 +1000 From: Cameron Simpson To: Gregory Ewing Subject: Re: object.enable() anti-pattern MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) References: X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=e/de0tV/ c=1 sm=1 a=wom5GMh1gUkA:10 a=GCTqkX7shA8A:10 a=kj9zAlcOel0A:10 a=vrnE16BAAAAA:8 a=ZtCCktOnAAAA:8 a=KPWSBcU8E6wA:10 a=CBnJBgOZESbkmvBY31gA:9 a=CjuIK1q_8ugA:10 a=ChdAjXE5lkUvdteQbhpnkQ==:117 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1368087823 news.xs4all.nl 15891 [2001:888:2000:d::a6]:35041 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45019 On 09May2013 19:54, Greg Ewing wrote: | Steven D'Aprano wrote: | >There is no sensible use-case for creating a file without opening | >it. What would be the point? | | Early unix systems often used this as a form of locking. Not just early systems: it's a nice lightweight method of making a lockfile even today if you expect to work over NFS, where not that many things are synchronous. You open a file with "0" modes, so that it is _immediately_ not writable. Other attempts to make the lock file thus fail because of the lack of write, even over NFS. Cheers, -- Cameron Simpson You can listen to what everybody says, but the fact remains that you've got to get out there and do the thing yourself. - Joan Sutherland