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

testWatch() Fails on First Run #21

Open
nvzqz opened this issue May 8, 2016 · 3 comments
Open

testWatch() Fails on First Run #21

nvzqz opened this issue May 8, 2016 · 3 comments
Assignees

Comments

@nvzqz
Copy link
Owner

nvzqz commented May 8, 2016

When testing FileKit, testWatch() will sometimes fail on the first attempt. I'm not familiar with GCD, so I don't necessarily know why this occurs.

@phimage
Copy link
Collaborator

phimage commented May 8, 2016

ok, I will do some tests when I have access to a mac computer

Just for information on OSX this is not a GCD implementation but a file system event one
(on the contrary, GCD is used in PR #20)

@nvzqz
Copy link
Owner Author

nvzqz commented May 8, 2016

I just figured it used GCD since it uses dispatch queues.

@ijumps
Copy link

ijumps commented May 8, 2016

Fail on the first time because the watch call the delegate when a create event happens. I fix this to support call a block. After create the file, the watcher then watch the path itself, not happend the first time because the path not exists. If you want to monitor other events, maybe call sleep(1) after you create the file. Create and write files happen so quick, so maybe only create event could be catched. Or find a better way to monitor a create event.

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

No branches or pull requests

3 participants