PHP: php_stream_seek - Manual

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

search for in the

php_stream_tell php_stream_flush

Last updated: Fri, 26 Jan 2007

view this page in

# php_stream_seek

php_stream_seek -- Reposition a stream

## Description

int php_stream_seek ( php_stream * stream, off_t offset, int whence )

php_stream_seek() repositions the internal position of `stream`. The new position is determined by adding the `offset` to the position indicated by `whence`. If `whence` is set to `SEEK_SET`, `SEEK_CUR` or `SEEK_END` the offset is relative to the start of the stream, the current position or the end of the stream, respectively.

php_stream_seek() returns 0 on success, but -1 if there was an error.

> Замечание: Not all streams support seeking, although the streams API will emulate a seek if `whence` is set to `SEEK_CUR` and `offset` is positive, by calling php_stream_read() to read (and discard) `offset` bytes.

> The emulation is only applied when the underlying stream implementation does not support seeking. If the stream is (for example) a file based stream that is wrapping a non-seekable pipe, the streams api will not apply emulation because the file based stream implements a seek operation; the seek will fail and an error result will be returned to the caller.

add a note User Contributed Notes
php_stream_seek
There are no user contributed notes for this page.
php_stream_tell php_stream_flush

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