• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/io/file.php
  • Класс: BitrixMainIOFile
  • Вызов: File::seek
public function seek($position)
{
	if(!$this->filePointer)
	{
		throw new FileNotOpenedException($this->originalPath);
	}

	if($position <= PHP_INT_MAX)
	{
		return fseek($this->filePointer, $position, SEEK_SET);
	}
	else
	{
		$res = fseek($this->filePointer, 0, SEEK_SET);
		if($res === 0)
		{
			do
			{
				$offset = ($position < PHP_INT_MAX? $position : PHP_INT_MAX);
				$res = fseek($this->filePointer, $offset, SEEK_CUR);
				if($res !== 0)
				{
					break;
				}
				$position -= PHP_INT_MAX;
			}
			while($position > 0);
		}
		return $res;
	}
}