note 34050 added to function.stream-get-meta-data

From: Date: Mon, 14 Jul 2003 22:24:40 +0000
Subject: note 34050 added to function.stream-get-meta-data
Groups: php.notes 
Request: Send a blank email to php-notes+get-52106@lists.php.net to get a copy of this message
A heads up to anyone using this with stream blocking set to false... 'unread_bytes' in the returned array may be set to '0' even if there ARE unread_bytes, which may not be what one intuitively expects. A suitable work around is to call fread($your_fp, 1) before calling stream_get_meta_data, which has the effect of 'refreshing' the returnable values. Of course, doing this, you would want to assign the return value of 'fread' to some meaningful collector variable so as to account for the possibly lost byte, depending on whether or not there was actually any unread bytes. This behavior is current as of PHP 4.3.2 on Redhat Linux 7.3. ---- Manual Page -- http://www.php.net/manual/en/function.stream-get-meta-data.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34050 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34050&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34050&report=yes

« previous php.notes (#52106) next »