Message256559
Seems this object should also incapsulate weakref to opened file... (to prevent using it on another text file)
* after writing, all objects, that incapsulate offset > current (during start of write()) should become invalid.
* truncate(arg) should also make that objects invalid for offsets > arg
One bad thing: seeking to the end of file is not safe:
If someone opens logfile, last byte in that text file may belong to middle of multibyte sequence. This really may happen, since Linux (libc) writes files page-by-page (if not line-buffered), so if page boundary is inside character, this bad thing may happen. Real case - is implementing something like `tail -f` in python (to, say, monitor log files).
So, seeking to the end of file is also wrong, and should be disallowed. If so, how to append text to text files ? very upset :( :( I don't know decision of that problem. |
|
Date |
User |
Action |
Args |
2015-12-16 22:59:26 | socketpair | set | recipients:
+ socketpair, pitrou, vstinner, ezio.melotti, r.david.murray, martin.panter |
2015-12-16 22:59:26 | socketpair | set | messageid: <1450306766.2.0.540948824943.issue25849@psf.upfronthosting.co.za> |
2015-12-16 22:59:26 | socketpair | link | issue25849 messages |
2015-12-16 22:59:25 | socketpair | create | |
|