[Python-ideas] Proposing new file-like object methods

Random832 random832 at fastmail.com
Mon Aug 1 22:00:20 EDT 2016


On Mon, Aug 1, 2016, at 20:27, Wes Turner wrote:
> file.pread?

Wouldn't that be rather like having os.fstatat?

For the concept in general, I'm concerned that the equivalent
functionality on windows may require that the I/O be done
asynchronously, or that the file have been opened in a special way. Any
Windows expert care to comment?

Also, I don't think windows has pread [etc] functions. Will integrating
support for it into high-level files require us to implement our own
read/write logic independent of msvcrt? How does this interact with
files that may have been opened in text mode via os.open or
msvcrt.setmode; or do we not care about compatibility for this case?
Should O_TEXT and msvcrt.setmode be deprecated?

> > For text files, offset would probably be not supported or count in
> characters. New methods could be added like readp/writep/fsync instead of
> modifying current methods, its debatable.


More information about the Python-ideas mailing list