public function streamSeek($offset, $whence)
{
switch ($whence) {
case SEEK_SET:
if ($offset < strlen(self::$data[$this->path]) and $offset >= 0) {
self::$position[$this->path] = $offset;
return true;
}
break;
case SEEK_CUR:
if ($offset >= 0) {
self::$position[$this->path] += $offset;
return true;
}
break;
case SEEK_END:
if (strlen(self::$data[$this->path]) + $offset >= 0) {
self::$position[$this->path] = strlen(self::$data[$this->path]) + $offset;
return true;
}
break;
default:
return false;
}
return false;
}