use system.dos_attr.* for both mode and stat info

this enables getting all the info needed for the FileInfo in a single request, instead of requiring two
This commit is contained in:
Robin Appelman 2020-03-24 16:29:44 +01:00
commit b594f7c408
2 changed files with 30 additions and 36 deletions

View file

@ -94,9 +94,7 @@ class NativeShare extends AbstractShare {
$name = $file['name'];
if ($name !== '.' and $name !== '..') {
$fullPath = $path . '/' . $name;
$files [] = new NativeFileInfo($this, $fullPath, $name, function () use ($fullPath) {
return $this->getStat($fullPath);
});
$files [] = new NativeFileInfo($this, $fullPath, $name);
}
}
@ -109,7 +107,12 @@ class NativeShare extends AbstractShare {
* @return \Icewind\SMB\IFileInfo
*/
public function stat($path) {
return new NativeFileInfo($this, $path, self::mb_basename($path), $this->getStat($path));
$info = new NativeFileInfo($this, $path, self::mb_basename($path));
// trigger attribute loading
$info->getSize();
return $info;
}
/**