Use stat to fetch mode

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2020-01-08 12:58:38 +01:00
commit 26ba16309d
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

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