On Sat, Sep 24, 2016 at 02:37:38PM +0200, Holger Freyther wrote:
Please remember that this is the stdin case:
a.) If on each primitive call we want to read 0 or 1 character let's remove the check if a \r or \n was read (as bytesRead == 1 and the loop will be terminated anyway).
b.) Let's try to read closer to count? If we assume line buffering and we have read one character it is likely we can read another until either count or \r\n is reached?
What were the original issues that motivated different handling of stdio streams in the sqFileReadIntoAt function? Based on the change history, I assume that it was driven by platform specific issues on Windows or Mac, but I don't know what the actual issues were.
My assumption is that isStdioStream was originally added to SQFile by Andreas to allow support for win32 console behavior. The implementation of sqFileReadIntoAt for Windows is in the win32 tree (it uses HANDLE rether than (FILE *) and is different from the Cross implementation used by other platforms). So the conditional code in Cross is presumably related to Mac or OS X issues, is that right?
Curious,
Dave