> It's fine for writing (as shown of one of those pages) but I found it > troublesome for reading. Basically you'd have to base generic > readline, gets and such, on a class-specific implementation of > something as small as a getc. Why? I would suggest that the implementation relies on read(byteCount). You can mantain a buffer (e.g. with gets if you can't pass all of it on to the caller). > Can you see yourself iterating through > each byte until you find the pattern? I _think_ it's a bit > inefficient compared to (at least non-greedy) regexps. (I'd be happy > to be proven wrong, though!) Yep. getc would be too inefficient, but it is not necessary. Thomas