Пример #1
0
 /**
  * @return \Icewind\SMB\IShare[]
  * @throws \Icewind\SMB\Exception\AuthenticationException
  * @throws \Icewind\SMB\Exception\InvalidHostException
  */
 public function listShares()
 {
     $this->connect();
     $shares = array();
     $dh = $this->state->opendir('smb://' . $this->getHost());
     while ($share = $this->state->readdir($dh)) {
         if ($share['type'] === 'file share') {
             $shares[] = $this->getShare($share['name']);
         }
     }
     $this->state->closedir($dh);
     return $shares;
 }
Пример #2
0
 /**
  * Get extended attributes for the path
  *
  * @param string $path
  * @param string $attribute attribute to get the info
  * @param mixed $value
  * @return string the attribute value
  */
 public function setAttribute($path, $attribute, $value)
 {
     $this->connect();
     if ($attribute === 'system.dos_attr.mode' and is_int($value)) {
         $value = '0x' . dechex($value);
     }
     return $this->state->setxattr($this->buildUrl($path), $attribute, $value);
 }
Пример #3
0
 public function stream_truncate($size)
 {
     return $this->state->ftruncate($this->handle, $size);
 }