PHP: php_stream_copy_to_mem - Manual

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

search for in the

php_stream_make_seekable php_stream_copy_to_stream

Last updated: Fri, 26 Jan 2007

view this page in

# php_stream_copy_to_mem

php_stream_copy_to_mem -- Copy data from stream and into an allocated buffer

## Description

size_t php_stream_copy_to_mem ( php_stream * src, char ** buf, size_t maxlen, int persistent )

php_stream_copy_to_mem() allocates a buffer `maxlen`+1 bytes in length using pemalloc() (passing `persistent`). It then reads `maxlen` bytes from `src` and stores them in the allocated buffer.

The allocated buffer is returned in `buf`, and the number of bytes successfully read. You, the caller, are responsible for freeing the buffer by passing it and `persistent` to pefree().

If you want to copy all remaining data from the `src` stream, pass the constant `PHP_STREAM_COPY_ALL` as the value of `maxlen`.

> Замечание: This function will attempt to copy the data in the most efficient manner, using memory mapped files when possible.

add a note User Contributed Notes
php_stream_copy_to_mem
There are no user contributed notes for this page.
php_stream_make_seekable php_stream_copy_to_stream

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