Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX Compatibility #3

Open
davidwdan opened this issue Mar 10, 2015 · 3 comments
Open

OSX Compatibility #3

davidwdan opened this issue Mar 10, 2015 · 3 comments
Assignees
Labels

Comments

@davidwdan
Copy link

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.

@WyriHaximus WyriHaximus self-assigned this Mar 10, 2015
@WyriHaximus
Copy link
Member

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
Copy link
Member

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

@davidwdan
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants