/** * @return \SMBBundle\SMB\IShare[] * @throws \SMBBundle\SMB\Exception\AuthenticationException * @throws \SMBBundle\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; }
/** * 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); }
public function stream_truncate($size) { return $this->state->ftruncate($this->handle, $size); }