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


Groups > comp.lang.python > #25276

Re: How to safely maintain a status file

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: How to safely maintain a status file
Date 2012-07-13 13:29 -0400
Organization > Bestiaria Support Staff <
References (4 earlier) <fd846619-7de7-4c3b-8ed6-a14e9d55956e@p6g2000yqg.googlegroups.com> <mailman.2061.1342145524.4697.python-list@python.org> <4fff926b$0$29965$c3e8da3$5496439d@news.astraweb.com> <62e90523-a160-4e28-8109-9ce32d8952e1@googlegroups.com> <4fffcadc$0$29965$c3e8da3$5496439d@news.astraweb.com>
Newsgroups comp.lang.python
Message-ID <mailman.2091.1342200621.4697.python-list@python.org> (permalink)

Show all headers | View raw


On 13 Jul 2012 07:14:36 GMT, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> 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/

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


Thread

Re: How to safely maintain a status file Laszlo Nagy <gandalf@shopzeus.com> - 2012-07-12 14:30 +0200
  Re: How to safely maintain a status file Hans Mulder <hansmu@xs4all.nl> - 2012-07-12 15:19 +0200
    Re: How to safely maintain a status file Laszlo Nagy <gandalf@shopzeus.com> - 2012-07-12 19:43 +0200
    Re: How to safely maintain a status file Christian Heimes <lists@cheimes.de> - 2012-07-12 20:39 +0200
      Re: How to safely maintain a status file Rick Johnson <rantingrickjohnson@gmail.com> - 2012-07-12 18:20 -0700
        Re: How to safely maintain a status file Chris Angelico <rosuav@gmail.com> - 2012-07-13 12:12 +1000
          Re: How to safely maintain a status file Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-13 03:13 +0000
            Re: How to safely maintain a status file Gene Heskett <gheskett@wdtv.com> - 2012-07-12 23:49 -0400
              Re: How to safely maintain a status file Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-13 04:21 +0000
            Re: How to safely maintain a status file rantingrickjohnson@gmail.com - 2012-07-12 21:26 -0700
              Re: How to safely maintain a status file Chris Angelico <rosuav@gmail.com> - 2012-07-13 16:02 +1000
              Re: How to safely maintain a status file Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-13 07:14 +0000
                Re: How to safely maintain a status file Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-07-13 13:29 -0400
              RE: How to safely maintain a status file "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-07-13 16:00 +0000
              Re: [Python] RE: How to safely maintain a status file Chris Gonnerman <chris@gonnerman.org> - 2012-07-13 12:27 -0500
              RE: [Python] RE: How to safely maintain a status file "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-07-13 17:59 +0000
                Re: [Python] RE: How to safely maintain a status file Hans Mulder <hansmu@xs4all.nl> - 2012-07-13 20:28 +0200
                Re: [Python] RE: How to safely maintain a status file MRAB <python@mrabarnett.plus.com> - 2012-07-13 20:57 +0100
                Re: [Python] RE: How to safely maintain a status file Christian Heimes <lists@cheimes.de> - 2012-07-13 22:21 +0200
              Re: [Python] RE: How to safely maintain a status file Chris Angelico <rosuav@gmail.com> - 2012-07-14 04:19 +1000
              RE: How to safely maintain a status file Chris Gonnerman <chris@gonnerman.org> - 2012-07-13 15:15 -0500
                Re: How to safely maintain a status file Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-14 01:53 +0000

csiph-web