apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Greene <greenecompcons...@cox.net>
Subject Re: apr_file_ungetc question
Date Sat, 20 May 2006 11:54:26 GMT
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.

     	ch 	The character to write.
     	thefile 	The file descriptor to write to

Ok, then the testfile should just check for 'T'.


View raw message