Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.04; 'compiler': 0.05; 'correspond': 0.07; 'subject:file': 0.07; 'subject:How': 0.09; 'abstraction': 0.09; 'buffer.': 0.09; 'derived': 0.09; 'filesystem': 0.09; 'pointers': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'stringio': 0.09; 'stored': 0.10; 'files.': 0.13; 'index': 0.13; 'amiga': 0.16; 'blocks': 0.16; 'constructs': 0.16; 'disk.': 0.16; "file's": 0.16; 'in-memory': 0.16; 'navigation': 0.16; 'posix': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'tape': 0.16; 'element': 0.17; 'example.': 0.17; 'specify': 0.17; 'mostly': 0.20; 'pascal': 0.22; 'defined': 0.22; "i've": 0.23; 'connected': 0.24; 'header': 0.24; 'header:X-Complaints-To:1': 0.28; '(since': 0.29; 'block,': 0.29; "d'aprano": 0.29; 'i/o': 0.29; 'seeks': 0.29; 'steven': 0.29; 'covered': 0.29; 'objects': 0.29; 'worked': 0.30; 'lists': 0.31; '(and': 0.32; 'file': 0.32; 'could': 0.32; 'url:home': 0.33; 'to:addr:python-list': 0.33; 'done': 0.34; 'list': 0.35; 'ahead': 0.35; 'moved': 0.35; 'open': 0.35; 'received:org': 0.36; 'but': 0.36; 'skip:{ 10': 0.36; "didn't": 0.36; 'useful': 0.36; 'charset:us-ascii': 0.36; 'does': 0.37; 'uses': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'object': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'relationship': 0.60; 'most': 0.61; 'real': 0.61; 'necessarily': 0.63; 'drive,': 0.65; 'jul': 0.65; 'tricks': 0.65; 'as:': 0.75; '(they': 0.84; 'around,': 0.84; 'subject:status': 0.84; 'dennis': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: How to safely maintain a status file Date: Fri, 13 Jul 2012 13:29:22 -0400 Organization: > Bestiaria Support Staff < References: <4ffecef4$0$6877$e4fe514c@news2.news.xs4all.nl> <4FFF0CB7.3030007@shopzeus.com> <4fff926b$0$29965$c3e8da3$5496439d@news.astraweb.com> <62e90523-a160-4e28-8109-9ce32d8952e1@googlegroups.com> <4fffcadc$0$29965$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-253-106-193.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES 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: 48 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342200621 news.xs4all.nl 6919 [2001:888:2000:d::a6]:53548 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25276 On 13 Jul 2012 07:14:36 GMT, Steven D'Aprano declaimed the following in gmane.comp.python.general: > > Open file objects do not necessarily correspond to files on disk. For > example, in standard Pascal, file objects are purely in-memory constructs > emulating files on a tape drive, with no relationship to on-disk files. > > (Any half-decent Pascal compiler or interpreter will *also* give you ways > to access real files on disk, but that isn't covered by the standard.) > Heck, in original Pascal, just reading from the console required tricks (since Pascal I/O is defined with a 1 element look-ahead, and I/O was opened at the start of execution). Mostly some internal flag to delay console reads until the program actually accessed the buffer. > a file name > an inode (blocks on a disk) > a file object > > Of course it is useful to break the abstraction that file objects must be > files on disk. StringIO is one such example. Standard Pascal file objects > is another. Likewise, it is useful to be able to read from an inode that > is no longer connected to a file name. > This does require a filesystem that uses "inode"s... Most computer systems I've worked on didn't have that concept (they predated the POSIX standard, and were not derived from UNIX). In the Amiga, the file name was stored in the file header block, not in a directory block -- finding a file was done by hashing the file name into an index in a directory block, and then following a linked list of file header blocks until the desired name was found (and the file header block contained pointers to the data blocks). {"Defragmenting" an Amiga drive could get fun, as one not only moved data blocks around, but could specify optimizations such as: position file header blocks immediately before the file's data blocks [reducing head seeks when reading the file] vs positioning file header blocks near their associated directory block [reducing head seeks when reading file names]; reordering the linked lists to put directory blocks ahead of file header blocks [making directory navigation faster], etc.} -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/