seek() 공개 메소드

Seek a position in the file.
public seek ( integer $position ) : void
$position integer Position in bytes
리턴 void
예제 #1
0
파일: ElggFileTest.php 프로젝트: elgg/elgg
 /**
  * @group FileService
  */
 public function testCanTellPosition()
 {
     $size = $this->file->getSize();
     $this->assertNotEmpty($size);
     $this->assertNotEmpty($this->file->open('read'));
     $this->assertEquals(0, $this->file->seek(2));
     $this->assertEquals(2, $this->file->tell());
     $this->assertFalse($this->file->eof());
     $this->assertEquals(0, $this->file->seek($size));
     $this->assertFalse($this->file->eof());
     $this->file->read(1);
     $this->assertTrue($this->file->eof());
     $this->assertTrue($this->file->close());
 }