Open jetjinser opened 2 months ago
Unfortunately, this would be difficult to add, because file descriptors at the OS level generally do not support peeking. Peeking requires a layer that buffers input from a file descriptor, and adding that to Zuo would be a big change and have all sorts of complicated interactions with processes and pipes.
Ah, that's a pity 🥲. I still think this would be a very useful procedure, can we keep it open for the possibility of implementing it in the future?
Thank you very much for your efforts anyway :)
Matthew Flatt @.***> 于 2024年8月28日周三 05:47写道:
Unfortunately, this would be difficult to add, because file descriptors at the OS level generally do not support peeking. Peeking requires a layer that buffers input from a file descriptor, and adding that to Zuo would be a big change and have all sorts of complicated interactions with processes and pipes.
— Reply to this email directly, view it on GitHub https://github.com/racket/zuo/issues/23#issuecomment-2313636702, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFG32CADYM6NC46LHESXFLZTTXWXAVCNFSM6AAAAABNGZGPVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJTGYZTMNZQGI . You are receiving this because you authored the thread.Message ID: @.***>
I hope that the
handle
can also be peeked. Unlikefd-read
, which consumes data, it retains the data and can be read/peek next time.I don't know if this makes sense, if I got anything wrong, please correct me. Thank you for your consideration!