Esempio n. 1
0
 public function testLseekCurPositive()
 {
     $state = smbclient_state_new();
     smbclient_state_init($state, null, SMB_USER, SMB_PASS);
     $file = smbclient_creat($state, $this->testuri);
     smbclient_write($state, $file, 'abcdefgh');
     $ret = smbclient_lseek($state, $file, 3, SEEK_CUR);
     $this->assertEquals(11, $ret);
     smbclient_write($state, $file, 'foo', 3);
     smbclient_close($state, $file);
     $this->assertStringEqualsFile($this->realfile, sprintf('%s%c%c%c%s', 'abcdefgh', 0, 0, 0, 'foo'));
 }
Esempio n. 2
0
 /**
  * @param resource $file
  * @param int $offset
  * @param int $whence SEEK_SET | SEEK_CUR | SEEK_END
  * @return int | bool new file offset as measured from the start of the file on success, false on failure.
  */
 public function lseek($file, $offset, $whence = SEEK_SET)
 {
     $result = @smbclient_lseek($this->state, $file, $offset, $whence);
     $this->testResult($result, $file);
     return $result;
 }