Move decoding the attribute string to the place it belongs

This commit is contained in:
Robin Appelman 2014-08-27 09:57:52 +02:00
commit d5106ac0a8
2 changed files with 3 additions and 5 deletions

View file

@ -101,7 +101,9 @@ class NativeFileInfo implements IFileInfo {
*/
protected function getMode() {
if (!$this->modeCache) {
$this->modeCache = $this->share->getAttribute($this->path, 'system.dos_attr.mode');
$attribute = $this->share->getAttribute($this->path, 'system.dos_attr.mode');
// parse hex string
$this->modeCache = hexdec(substr($attribute, 2));
}
return $this->modeCache;
}

View file

@ -248,10 +248,6 @@ class NativeShare implements IShare {
$this->connect();
$result = $this->state->getxattr($this->buildUrl($path), $attribute);
// parse hex string
if ($attribute === 'system.dos_attr.mode') {
$result = hexdec(substr($result, 2));
}
return $result;
}