Closed johnae closed 7 years ago
Or maybe https://github.com/passcod/rsnotify which is written in rust but with a less restrictive license.
This might be a fun thing to do but also sort of pointless. The binary isn't very large and we get lots of nice features with libuv.
One project that may be interesting is cqueues: http://25thandclement.com/%7Ewilliam/projects/cqueues.pdf and https://github.com/wahern/cqueues
As long as Windows support isn't interesting at least. Tbh there's already a dependency on ljsyscall (though only very limited usage) so Windows wouldn't "just work" anyway.
This will most probably be done using direct system calls instead as it provides the most control. I already have a somewhat working prototype for Linux and a branch will be up relatively soon. It also has the nice property of removing dependencies. There will be no libuv or cqueues dependency when this is done, only luajit and some vendored lua code.
Ongoing work in https://github.com/johnae/spook/pull/19
Done as of 0.7.0.
Using something built only for fs change notifications would reduce binary size and probably be give more information about "what happened". This could be one option:
https://github.com/emcrisostomo/fswatch
Another option might be to simply use ffi and hook into whatever notification system the fs has.