Пример #1
0
 public function testFstatVFS()
 {
     $state = smbclient_state_new();
     smbclient_state_init($state, null, SMB_USER, SMB_PASS);
     $file = smbclient_open($state, $this->testuri, 'r');
     $vfs = smbclient_fstatvfs($state, $file);
     smbclient_close($state, $file);
     smbclient_state_free($state);
     $this->assertTrue(is_array($vfs));
     $this->hasParts($vfs);
 }
Пример #2
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'));
 }
Пример #3
0
 public function close($file)
 {
     $result = @smbclient_close($this->state, $file);
     $this->testResult($result, $file);
     return $result;
 }