At 11:28 PM 2/17/2002 +0000, Wez Furlong wrote: >Can someone (Sascha?) refresh my memory about HAVE_FLUSHIO ?
"Sasha" != "Sascha" ;-) >I'm wondering how it will affect the php_streams implementation. > >This is what I recall about it: > >On some systems it is necessary to fflush before reading/writing if >you have been fseeking. > >Is this true/false/slightly incorrect? AFAIR the ANSI standard says that for files opened in read/write mode fseek should be called (for flushing) whenever your process switches from reading to writing or vice versa. Linux' glibc is smart, of course, and a problem doesn't occur there. However more compliant platforms like Solaris and BSD have trouble if you call read, write, read for example. >Should I keep a flag to track if we have just been seeking for >stdio based streams and move the HAVE_FLUSHIO logic into the >stdio stream implementation? If you use buffered I/O functions and open files in rw modes - yes (??? do you need this for the streams implementation - should read the document once more). However I would strongly recommend the PHP I/O system to organize file buffering internally (something the current implementation does partially and in quite fancy way) and to use unbuffered system I/O. If I am not clear enough - drop me a note and I will try to dig out the C and PHP examples that reproduced the problem... Rgds: -- Alex >--Wez. > > >-- >PHP Development Mailing List <http://www.php.net/> >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php