`std.Io.Reader.takeByte` behavior compared to `std.c.read` (opens in new tab)
Hi guys! I’ve been getting my hands dirty on the new Io reader and I think I need some help understanding the behavior of the takeByte function. Long story short, I’m trying to read from stdin byte by byte using the takeByte function, and it unexpectedly throws EndOfStream. but if I were to use either std.posix.read or std.c.read the code works like I expected it too, am I missing something important here? while (true) // this works var buf: [1]u8 = undefined; _ = c_api.read(c_api.STDIN_FILEN...
Read the original article