mirror of
https://github.com/danog/file.git
synced 2024-11-30 04:19:39 +01:00
Add nonblock and fsync flags in eio
Not 100% if these are needed, but it doesn't seem to hurt either.
This commit is contained in:
parent
4f9630298f
commit
0becf8af09
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Amp\File;
|
namespace Amp\File;
|
||||||
|
|
||||||
use Amp\{ Deferred, Failure, Loop, Promise, Success };
|
use Amp\{ Deferred, Loop, Promise, Success };
|
||||||
|
|
||||||
class EioDriver implements Driver {
|
class EioDriver implements Driver {
|
||||||
private $watcher;
|
private $watcher;
|
||||||
@ -54,7 +54,7 @@ class EioDriver implements Driver {
|
|||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function open(string $path, string $mode): Promise {
|
public function open(string $path, string $mode): Promise {
|
||||||
$flags = $this->parseMode($mode);
|
$flags = \EIO_O_NONBLOCK | \EIO_O_FSYNC | $this->parseMode($mode);
|
||||||
|
|
||||||
$chmod = ($flags & \EIO_O_CREAT) ? 0644 : 0;
|
$chmod = ($flags & \EIO_O_CREAT) ? 0644 : 0;
|
||||||
($this->incrementor)(1);
|
($this->incrementor)(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user