filesystem icon indicating copy to clipboard operation
filesystem copied to clipboard

OSX Compatibility

Open davidwdan opened this issue 10 years ago • 3 comments

On PHP 5.5.21 on OSX, this is what sometimes happens when I run (it doesn't always) https://github.com/reactphp/filesystem/blob/master/examples/directory_ls_recursive.php

Fatal error: Cannot use object of type React\Filesystem\Eio\RuntimeException as array in ... vendor/react/filesystem/src/Node/Directory.php on line 73

This is the exception:

class React\Filesystem\Eio\RuntimeException#1039 (8) {
  protected $message =>
  string(35) "Unknown error calling "eio_readdir""
...

If I check to see if $result is an array on https://github.com/reactphp/filesystem/blob/master/src/Node/Directory.php#L73, it works, but I'm guessing that it's missing some files or directories when that exception is thrown.

davidwdan avatar Mar 10 '15 21:03 davidwdan

Hah that's a good one. Will fix the exception ending up as an resolved promise instead of an rejected one.

The reason it somethings fails is still shrouded in mystery for me. One reason to create the queued invoker was for this. When running all the eio_readdir calls (which perform the ls of a directory) when ever they are invoked they would fail a lot more then running them using a queue. In queue it for some reason barely fails.

I've spend a fair amount of time trying to figure out why it's failing but haven't found it yet. Hence the reason I'm taking this path in order to make it workable.

WyriHaximus avatar Mar 10 '15 21:03 WyriHaximus

I've made a two commits (71def7a0027201c8f10c6b0774fdac8e07b30122 and ff508701e782158306a5bbf8b40ce1eec18a3507) that should address this and the other issues you're having. Can you test if this solves it for OS X?

WyriHaximus avatar Mar 25 '15 19:03 WyriHaximus

I'm still getting the occasional Unknown error calling "eio_readdir" error.

davidwdan avatar Mar 25 '15 20:03 davidwdan