PHP: php_stream_read - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

php_stream_write php_stream_open_wrapper

Last updated: Fri, 26 Jan 2007

view this page in

# php_stream_read

php_stream_read -- Read a number of bytes from a stream into a buffer

## Description

size_t php_stream_read ( php_stream * stream, char * buf, size_t count )

php_stream_read() reads up to `count` bytes of data from `stream` and copies them into the buffer `buf`.

php_stream_read() returns the number of bytes that were read successfully. There is no distinction between a failed read or an end-of-file condition - use php_stream_eof() to test for an `EOF`.

The internal position of the stream is advanced by the number of bytes that were read, so that subsequent reads will continue reading from that point.

If less than `count` bytes are available to be read, this call will block (or wait) until the required number are available, depending on the blocking status of the stream. By default, a stream is opened in blocking mode. When reading from regular files, the blocking mode will not usually make any difference: when the stream reaches the `EOF` php_stream_read() will return a value less than `count`, and 0 on subsequent reads.

add a note User Contributed Notes
php_stream_read
There are no user contributed notes for this page.
php_stream_write php_stream_open_wrapper

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST