1
0
mirror of https://github.com/danog/file.git synced 2024-11-26 20:04:51 +01:00

eio isfile update

This commit is contained in:
Daniel Lowrey 2015-07-18 15:29:18 -04:00
parent 77c8271db6
commit 06b6353e8b
2 changed files with 4 additions and 7 deletions

View File

@ -121,8 +121,8 @@ class EioDescriptor implements Descriptor {
\eio_get_last_error($req)
));
} else {
$stat["isdir"] = (bool) ($stat["mode"] & Filesystem::S_IFDIR);
$stat["isfile"] = (bool) ($stat["mode"] & Filesystem::S_IFREG);
$stat["isfile"] = (bool) ($stat["mode"] & \EIO_S_IFREG);
$stat["isdir"] = empty($stat["isfile"]);
}
\call_user_func($this->decrement);
$promisor->succeed($result);

View File

@ -9,9 +9,6 @@ use Amp\Failure;
use Amp\Deferred;
class EioFilesystem implements Filesystem {
const S_IFDIR = 0x4000;
const S_IFREG = 0x8000;
private $reactor;
private $stream;
private $watcher;
@ -114,8 +111,8 @@ class EioFilesystem implements Filesystem {
$stat = null;
} else {
$stat = $result;
$stat["isdir"] = (bool) ($stat["mode"] & self::S_IFDIR);
$stat["isfile"] = (bool) ($stat["mode"] & self::S_IFREG);
$stat["isfile"] = (bool) ($stat["mode"] & \EIO_S_IFREG);
$stat["isdir"] = empty($stat["isfile"]);
}
$this->decrementPending();
$promisor->succeed($stat);