Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45068

Re: object.enable() anti-pattern

Date 2013-05-10 09:29 +1000
From Cameron Simpson <cs@zip.com.au>
Subject Re: object.enable() anti-pattern
References <518C29AD.7070302@canterbury.ac.nz>
Newsgroups comp.lang.python
Message-ID <mailman.1513.1368144164.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 10May2013 10:56, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
| Cameron Simpson wrote:
| >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,
| 
| I don't think that's quite right. You open it with
| O_CREAT+O_EXCL, which atomically fails if the file
| already exists. The read/write modes don't really
| come into it, as far as I know.

Interesting. That is more direct. My understanding that it was
enough to create the file with 0 modes. Maybe either will do. Must
check...

Cheers,
-- 
Cameron Simpson <cs@zip.com.au>

Piracy gets easier every day, but listening to legally purchased music gets harder by the day.
Firehed - http://politics.slashdot.org/comments.pl?sid=179175&cid=14846089

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: object.enable() anti-pattern Cameron Simpson <cs@zip.com.au> - 2013-05-10 09:29 +1000

csiph-web