William A. Rowe, Jr. wrote:
Michael Greene wrote:
Once again getting APR 1.2.7 working with OS/2 and Open Watcom, I have
a failure during testfile. The test is failing at test_ungetc. Part
seems to be the test and part the OS/2 source. In the test, the file
is opened APR_READ not APR_READ|APR_WRITE. However, I also need to
know exactly how apr_file_ungetc should actually work.
ungetc simply 'puts back' or backs up the current offset by one. So the
next
read should again read the previously last character read - it's an
optimization
if you are, say, reading to EOL, and find a /r or /n, and then back up
one to
leave the pointer at the char you just read.
Write access must NOT be required ;-/
Bill
Thanks Bill,
Ok, then the docs mislead?
Put a character back onto a specified stream.
Parameters:
ch The character to write.
thefile The file descriptor to write to
Ok, then the testfile should just check for 'T'.
Michael