[PHP-DEV] buffered io - sparc solaris From: Alexander Feldman (alex <email protected>)
Date: 02/19/01

Hi,

>From the fopen(3) manual page on Solaris 2.6 (it is the same on Solaris 7
and Solaris 8):

     When a file is opened with update mode (+ as the second or
     third character in the mode argument), both input and output
     may be performed on the associated stream. However, output
     must not be directly followed by input without an interven-
     ing call to fflush(3S) or to a file positioning function
     (fseek(3S), fsetpos(3S) or rewind(3S)), and input must not
     be directly followed by output without an intervening call
     to a file positioning function, unless the input operation
     encounters end-of-file.

The nasty behaviour remains even if we disable the buffering with call to
setbuf. This imposes a significant compatibility problem with the PHP file
io functions. The decision is to call explicitly fflush() when changing
the direction of the data flow.

I prepared a fix for this (it can be optimized and improved heavily), but
before I commit it I want to hear your opinion. Please see the attachment.

Thank you:

--
Alexander Feldman
Zend Technologies Ltd.
phone: +972 3 6139665 ext. 113, fax: +972 3 6139671
http://www.zend.com

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>