Message326201
> lseek() succeeds on pipes on Windows, but is nearly useless
lseek isn't meaningful for pipe and character files (i.e. FILE_TYPE_PIPE and FILE_TYPE_CHAR). While SEEK_SET and SEEK_CUR operations trivially succeed in these cases, the underlying device simply ignores the current file position. I think it would be reasonable to fail these cases instead of succeeding misleadingly.
When a file is opened for synchronous access, its FilePositionInformation is managed by the I/O manager, not the device or file system. All the I/O manager does is get or set the CurrentByteOffset value in the File object [1]. It doesn't matter whether the device actually uses this information.
Regarding the observed SEEK_END behavior, the named-pipe file system (NPFS) supports querying the FileStandardInformation of a pipe, in which it sets the EndOfFile value as the number of bytes available to be read from the pipe's inbound (server-side) queue. So SEEK_END (or WinAPI FILE_END) does provide some information to us, but it's misleading because the seek itself is meaningless.
[1]: https://msdn.microsoft.com/en-us/library/windows/hardware/ff545834 |
|
Date |
User |
Action |
Args |
2018-09-24 04:50:12 | eryksun | set | recipients:
+ eryksun, paul.moore, vstinner, tim.golden, zach.ware, steve.dower, izbyshev |
2018-09-24 04:50:11 | eryksun | set | messageid: <1537764611.97.0.956365154283.issue34780@psf.upfronthosting.co.za> |
2018-09-24 04:50:11 | eryksun | link | issue34780 messages |
2018-09-24 04:50:11 | eryksun | create | |
|