After wasting 2 hours trying to get sgi's fam (File Alteration Monitor:
http://oss.sgi.com/projects/fam/) working in our custom LFS systems, I turned to inotify and found Aria's Ruby extension for it (
http://raa.ruby-lang.org/project/ruby-inotify/).
It did build (with a few warnings) but running the tests threw:
Loaded suite tests/test_1
Started
.ruby: symbol lookup error: ./inotify.so: undefined symbol: RSTRING_PTR
Being an absolute beginner with Ruby extensions, it took me several attempts to figure out the right way to do it under Ruby 1.8.4. Here is what I ended up changing in inotify.c:
87c87
< wd = inotify_add_watch(*fd, RSTRING_PTR(filename), NUM2INT(mask));
---
> wd = inotify_add_watch(*fd, RSTRING(filename)->ptr, NUM2INT(mask));
89c89
< rb_sys_fail(RSTRING_PTR(filename));
---
> rb_sys_fail(RSTRING(filename)->ptr);
The warnings are now gone from compilation and the small test pass. I must say that the first test run blocked on the test4 in the each_event iterator and I had to kill the process. I could not however reproduce it on any of the attempts I made.
I am pretty confident that this macro is still supported in later versions of Ruby but I do not have the time to check if it is being deprecated, I will try and contact Aredridel once I am convinced this patch works OK.