This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: file seek error
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: lawhorn999, tim.peters
Priority: normal Keywords:

Created on 2005-02-12 00:36 by lawhorn999, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ErrorReport.py lawhorn999, 2005-02-12 00:36 File seek error
Messages (2)
msg24265 - (view) Author: Richard Lawhorn (lawhorn999) Date: 2005-02-12 00:36
When opening a file for overwrite ("rb+"), sucessive
read/writes fail to advance the pointer. The tell()
indicates that the pointer is advancing, but the
resulting file simply repeats an earlier record.

See attached file for an example.  
msg24266 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2005-02-12 01:54
Logged In: YES 
user_id=31435

Sorry, write the code in C and you'll see the same behavior.  
For a file opened for update, the effect of input followed by 
output is undefined unless a file-positioning call is made 
between the I/O calls; the effect of output followed by input 
is also undefined, unless a file-positioning call or a call to flush
() is made between them.  Your comment "This line should 
NOT be needed" is simply incorrect:  you are in fact trying to 
do input immediately following output.  If you want defined 
behavior, then you must seek between them, and/or flush() 
after the write().
History
Date User Action Args
2022-04-11 14:56:09adminsetgithub: 41566
2005-02-12 00:36:39lawhorn999create