What happened to readUntilDelimiterOrEof and other input/output functions in zig 15

I have just installed zig 15, and it seems that input/output has changed quite a lot. getStdIn etc have disappeared, and if I use a reader based I can’t find
readUntilDelimiterOrEof anymore. The site zig.guide hasn’t been updated and most information is out of date. Can anybody point me in the right direction? Most of my programs used these functions, and thus are broken…

2 Likes

Yeah, dealing with delimiter in a read stream is a big change in 0.15.1. I’ve looked at various reading API dealing with delimiter, like takeDelimiterExclusive when doing the migration. One caveat is most of them only look for the delimiter in the current buffer. You have to deal with the StreamTooLong error if the delimiter is beyond the current buffer.

streamDelimiter and streamDelimiterLimit are the ones that can read beyond the current buffer. You can look at readHttpHeaders to see how streamDelimiter is being used. The reading of a whole request starts from readContentLengthFrame if you want to start from the beginning.

3 Likes