Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsreader4.netcologne.de!news.netcologne.de!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'context': 0.04; 'memory.': 0.05; 'broken.': 0.07; 'received:edu.au': 0.07; 'removes': 0.07; 'deletes': 0.09; 'overwrite': 0.09; 'to:addr:comp.lang.python': 0.09; 'wrote:': 0.15; 'does,': 0.16; 'filename.': 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; '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; 'released.': 0.16; 'sane': 0.16; 'cc:addr:python-list': 0.16; 'cheers,': 0.19; 'memory': 0.21; 'cc:2**0': 0.21; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; '(b)': 0.23; 'filled.': 0.23; 'asked': 0.24; "i'm": 0.27; 'right.': 0.28; 'cc:addr:python.org': 0.30; '(f)': 0.30; 'file.': 0.32; 'reference': 0.33; 'header:User-Agent:1': 0.34; 'be.': 0.34; '(a)': 0.35; 'uses': 0.35; 'charset:us-ascii': 0.36; 'file': 0.36; 'received:au': 0.36; 'open': 0.37; 'but': 0.37; 'subject:: ': 0.38; 'systems,': 0.40; 'delete': 0.40; 'more.': 0.61; 'managers': 0.62; 'link': 0.63; 'skip:$ 10': 0.63; 'taking': 0.65; 'received:202': 0.66; 'believe': 0.66; 'association': 0.66; 'cameron': 0.67; 'memory,': 0.67; 'subject:program': 0.67; 'afraid': 0.68; 'income.': 0.68 Date: Sun, 17 Jul 2011 09:19:41 +1000 From: Cameron Simpson To: comp.lang.python@googlegroups.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: User-Agent: Mutt/1.5.21 (2010-09-15) References: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310858384 news.xs4all.nl 23839 [2001:888:2000:d::a6]:41796 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9655 On 16Jul2011 10:34, Josh English wrote: | I found a FileLock (lost the link and it's not in the code) that uses | context managers to create a ".lock" file in the same directory of the | file. It uses os.unlink to delete the .lock file but I don't know if | this deletes the file or just removes it from the directory and leaves | the memory filled. os.unlink removes the filename. On all sane systems, if that is the last reference to the file (no other names, no open file handles) then the memory/storage is also released. | If it does, I don't know if the OS will overwrite | that memory. I'm afraid of taking up lots of space that I don't need | with this program. Don't be. | The docs indicate that Unix recovers the memory, but I'm not sure about Windows. I confess to disliking Windows, but I do not believe it is that broken. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Last month, my alumni/ae association sent out a questionnaire. One of the questions they asked was my/my household's annual income. The choices were: (a) Less than $25,000, (b) $25,001-50,000, (c) $50,001-100,000, (d) $100,001-250,000, (e) $250,001-500,000, (f) $500,001-1,000,000, (g) $1,000,000 or more. Yeah, right. Nice median. - Dan Hillman, dcah100@cus.cam.ac.uk