Overview
| Artifact ID: | f5c20f8f4ad0ed975f287a0407a6f87320dcfa5c |
|---|---|
| Ticket: | 2901998fffffffffffffffffffffffffffffffff
Inconsistent buffered I/O |
| User & Date: | ferrieux on 2009-11-22 10:49:10 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- comment changed to:
On a seekable r+ channel (like a regular file), read and write operations have inconsistent interactions depending on the kind of buffering: Suppose file "foo" contains "ABC": set f [open foo r+] fconfigure $f -buffering none puts -nonewline $f Z puts [read $f] ----> BC Now reset the file to ABC and try it in buffered mode: set f [open foo r+] fconfigure $f -buffering full puts -nonewline $f Z puts [read $f] ----> ABC This is inconsistent. Buffering should only have effects on performance, not on semantics. Being consistent would imply always keeping the notion of a single read/write "cursor" at script level, regardless of the underlying OS-level file position pointer. Note that maintaining this simple coupling means simpler code in the core, the only new thing being that a read operation could now cause a flush. I have no problem with this side-effect, since buffering/flushing always happens behind the scripter's back anyway ([seek] already does it sometimes). This bug is related to, but much simpler and spectacular than, bug 2176669. The fix proposed here would solve both simultaneously BTW.
- foundin changed to: "None"
- is_private changed to: "0"
- priority changed to: "8"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "ferrieux"
- subsystem changed to: "25. Channel System"
- title changed to: "Inconsistent buffered I/O"
- type changed to: "Bug"