Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #9576
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <cameron@cskk.homeip.net> |
| 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; 'mentioned,': 0.04; 'received:edu.au': 0.07; 'silently': 0.09; 'wrote:': 0.15; 'billy': 0.16; 'chmod': 0.16; 'fiddle': 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; 'mkdir': 0.16; 'received:202.125.174': 0.16; 'received:202.125.174.133': 0.16; 'received:boardofstudies.nsw.edu.au': 0.16; 'received:cskk.homeip.net': 0.16; 'received:harvey.boardofstudies.nsw.edu.au': 0.16; 'received:homeip.net': 0.16; 'received:nsw.edu.au': 0.16; 'cc:addr :python-list': 0.16; 'question.': 0.16; 'exists': 0.19; 'cheers,': 0.19; 'cc:2**0': 0.21; 'cc:no real name:2**0': 0.22; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'ken': 0.23; 'locking': 0.23; 'once.': 0.23; 'xml': 0.25; 'up.': 0.26; '(and': 0.27; 'cc:addr:python.org': 0.30; 'lock': 0.30; 'this.': 0.31; "won't": 0.32; 'it.': 0.33; 'header:User-Agent:1': 0.34; 'there': 0.34; "can't": 0.34; 'doc': 0.35; 'charset:us-ascii': 0.36; 'file': 0.36; 'received:au': 0.36; 'drives': 0.37; 'but': 0.37; 'could': 0.37; 'using': 0.37; 'another': 0.38; 'subject:: ': 0.38; 'george': 0.38; 'two': 0.38; 'put': 0.38; 'either': 0.39; 'might': 0.39; 'plain': 0.40; 'give': 0.60; 'your': 0.60; 'happen': 0.62; 'received:202': 0.66; 'cameron': 0.67; 'subject:program': 0.67; 'habit': 0.84; 'nfs': 0.84; 'problematic': 0.84; 'dream': 0.97 |
| Date | Sat, 16 Jul 2011 08:37:41 +1000 |
| From | Cameron Simpson <cs@zip.com.au> |
| To | Billy Mays <81282ed9a88799d21e77957df2d84bd6514d9af6@myhashismyemail.com> |
| Subject | Re: Looking for general advice on complex program |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| In-Reply-To | <ivq6ej$vpp$2@speranza.aioe.org> |
| User-Agent | Mutt/1.5.20 (2009-06-14) |
| References | <ivq6ej$vpp$2@speranza.aioe.org> |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1084.1310769466.1164.python-list@python.org> (permalink) |
| Lines | 26 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1310769466 news.xs4all.nl 23982 [2001:888:2000:d::a6]:60470 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:9576 |
Show key headers only | View raw
On 15Jul2011 16:03, Billy Mays <81282ed9a88799d21e77957df2d84bd6514d9af6@myhashismyemail.com> wrote:
| I remember reading that file locking doesn't work on network mounted
| drives (specifically nfs mounts), but you might be able to simply
| create a 'lock' (mydoc.xml.lock or the like) file for the XML doc in
| question. If that file exists you could either hang or silently
| give up. Not sure if that helps.
There are two approaches to this. Plain old make-a-file won't work - it
is racy (and as mentioned, you can't rely on the various lock
facilities).
You can create a file while your umask is 0777; it will be non-writable
immediately (no chmod required), preventing another attempt to make it.
My personal habit is to make a directory for the lock; mkdir
also can't happen twice to the same name, you don't need to fiddle you
umask (racy and annoying, and problematic if you're using multiple
threads), _and_ you can put meta info inside it, like pid files etc.
Cheers,
--
Cameron Simpson <cs@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/
I had a wierd dream with Ken Thompson in it once.
- George Politis <george@research.canon.com.au>
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Looking for general advice on complex program Josh English <Joshua.R.English@gmail.com> - 2011-07-15 12:47 -0700
Re: Looking for general advice on complex program Billy Mays <81282ed9a88799d21e77957df2d84bd6514d9af6@myhashismyemail.com> - 2011-07-15 16:03 -0400
Re: Looking for general advice on complex program Cameron Simpson <cs@zip.com.au> - 2011-07-16 08:37 +1000
Re: Looking for general advice on complex program Chris Angelico <rosuav@gmail.com> - 2011-07-16 10:01 +1000
Re: Looking for general advice on complex program geremy condra <debatem1@gmail.com> - 2011-07-16 14:08 -0400
csiph-web