buffered io - sparc solaris

From: Date: Mon, 19 Feb 2001 19:18:45 +0000
Subject: buffered io - sparc solaris
Groups: php.dev 
Request: Send a blank email to php-dev+get-46948@lists.php.net to get a copy of this message
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

« previous php.dev (#46948) next »