Subject:
[ruby-ffi] Following the examples guide
From:
Fonsan
Date:
3/7/11 7:35 AM
To:
ruby-ffi

Hi

I'm playing around with the autotest-fsevent gem to make it more
efficient, right now it sleeps until any change happens and then does
a full search. The idea is to only pass the files changed into the
find_files_to_test method

The current solution is to compile a simple c program
https://github.com/svoop/autotest-fsevent/blob/master/ext/fsevent/fsevent_sleep.c
That is later called as a binary from ruby.

I have been following https://github.com/ffi/ffi/wiki/Examples

And compiled the c file with the -c flag although I must admit my C is
a bit rusty

Here is the c, ruby and output

https://gist.github.com/858504