You are here

public function DrupalRemoteStreamWrapper::stream_seek in Remote Stream Wrapper 7

Support for fseek().

Parameters

$offset: The byte offset to got to.

$whence: SEEK_SET, SEEK_CUR, or SEEK_END.

Return value

TRUE on success.

Overrides StreamWrapperInterface::stream_seek

See also

http://php.net/manual/en/streamwrapper.stream-seek.php

File

./remote_stream_wrapper.inc, line 230

Class

DrupalRemoteStreamWrapper
Stream wrapper to support local files.

Code

public function stream_seek($offset, $whence) {
  if (strlen($this->stream_content) >= $offset) {
    $this->stream_pointer = $offset;
    return TRUE;
  }
  return FALSE;
}