false alarm - RTFM [was: [PYTHONMAC-SIG] file modes in Mac Python]

Steven D. Majewski sdm7g@Virginia.EDU
Fri, 11 Jul 1997 17:31:02 -0400 (EDT)

Sorry: false alarm...

I looked at Guido's dumdbm example and saw that it reopens the 
file before most operations. 

I tried writing, closeing, reopening for update, writing, closeing,
opening and reading the file and it updated properly. 

I dug up my copy of Plauger's "The Standard C Library", which is
much more heavily annotated than the Metrowerks MSL reference, 
and read up on <stdio.h>, and find:

  can't do write after read without a seek in between;
  can't do read after write without a flush in between; 

  'Unix' I/O doesn't have this restriction (and that's what I'ld normally
use if I was doing it in C).  os.open, os.read, os.write uses those
routines (I assume). Standard Python I/O uses stdio. ( Which I know
but forget sometimes, since the 'f' is dropped in the python methods:
I should just remember that file.write == fwrite, file.seek == fseek )

< I think I'll just fix my program and go back to worrying about who's
  going to buy Apple next week! :-> 

---|  Steven D. Majewski   (804-982-0831)  <sdm7g@Virginia.EDU>  |---
---|  Department of Molecular Physiology and Biological Physics  |---
---|  University of Virginia             Health Sciences Center  |---
---|  P.O. Box 10011            Charlottesville, VA  22906-0011  |---
All power corrupts and obsolete power corrupts obsoletely." - Ted Nelson

PYTHONMAC-SIG  - SIG on Python for the Apple Macintosh

send messages to: pythonmac-sig@python.org
administrivia to: pythonmac-sig-request@python.org