Skip to content

UvDriver cannot scan empty dir #23

Closed
@robberphex

Description

@robberphex

For this code:

<?php
require __DIR__ . '/vendor/autoload.php';

use Amp\File;
use Amp\Loop;
use App\App;

Loop::run(function () {
    $flist = yield File\scandir("/tmp/tmp/");
    var_dump($flist);
});

/tmp/tmp is empty dir


Run php72 -dmemory_limit=1024m /path/to/php.php, it throw a excepiton:

PHP Fatal error:  Uncaught Amp\File\FilesystemException: Failed reading contents from /tmp/tmp/ in /opt/pkgist/vendor/amphp/file/lib/UvDriver.php:420
Stack trace:
#0 [internal function]: Amp\File\UvDriver->Amp\File\{closure}(NULL, 0)
#1 /opt/pkgist/vendor/amphp/amp/lib/Loop/UvDriver.php(174): uv_run(Object(UVLoop), 1)
#2 /opt/pkgist/vendor/amphp/amp/lib/Loop/Driver.php(130): Amp\Loop\UvDriver->dispatch(true)
#3 /opt/pkgist/vendor/amphp/amp/lib/Loop/Driver.php(70): Amp\Loop\Driver->tick()
#4 /opt/pkgist/vendor/amphp/amp/lib/Loop.php(76): Amp\Loop\Driver->run()
#5 /opt/pkgist/bin/gc2(11): Amp\Loop::run(Object(Closure))
#6 {main}
  thrown in /opt/pkgist/vendor/amphp/file/lib/UvDriver.php on line 420

But run env AMP_LOOP_DRIVER='\Amp\Loop\EvDriver' php72 -dmemory_limit=1024m /path/to/php.php, it works normally:

array(0) {
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions