Alaric Snell-Pym scripsit: > Yep, but such readahead can be hidden from the user. You call > getchar() on a FILE *, and without you needing to pay any attention, > you only do a read() syscall every few KB, and everyone's a winner.
You're knocking the ball through your own goalposts. Stdio buffers, and that's a win. But what you give up on is precisely the ability to interleave stdio and Posix I/O. Why? Because the state of the underlying fd is not known after a random number of getchars. Buffering is good. Giving up on the ability to interleave buffered and unbuffered operations is the price you pay for it; IMHO a price worth paying. Exactly the same argument applies to character decoding/encoding. -- [W]hen I wrote it I was more than a little John Cowan febrile with foodpoisoning from an antique carrot [email protected] that I foolishly ate out of an illjudged faith http://ccil.org/~cowan in the benignancy of vegetables. --And Rosta _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
