Hi Holger,

Sorry for not noticing this thread before. Some months ago, I did some
experiments myself using inotify and epoll, with the UFFI. I was creating a
file system monitoring API similar in design to OSWindow. I just did some
minor changes for making this usable along with making a configure script.
I left all of the code and some scripts for loading the FileSystemMonitor
API at: http://smalltalkhub.com/#!/~ronsaldo/OSCalls .

For testing the monitoring API, try the following in a playground:

monitor := FileSystemMonitor for: '.' do: [ :event |
    Transcript show: event; cr.

If you do this, open a Transcript and you start browsing some methods in
Nautilus, you will start receiving some events where Pharo is accessing the
.changes file. For the destroying the monitor and stop receiving the
events, you can do the following:

monitor destroy.

Currently the events given by this API are only holding a copy of the raw
inotify event in rawEvent and a copy of the raw path in rawPath. Further
work is required for translating the events into a more platform
independent interface, and for supporting OS X and Windows with this API.
However, this is already something that could be useful to you.

Best regards,

2016-09-20 15:26 GMT-03:00 Holger Freyther <hol...@freyther.de>:

> Hi,
> I explored to use the Linux inotify API using UFFI. The
> inotify_init/inotify_init1 routine will me a Unix filedescriptor and I
> would like to
>         a.) monitor it for being readable
>         b.) read from it with a stream
> For a.) I have found the AioEventHandler and think I will be able to call
> >>#descriptor: directly and then can use it (still figuring out the API,
> probably just wait for the >>#changed: call).
> For b.) I thought I could use AttachableFileStream but that required a
> "fileId" but not a filedescriptor. Is there a way I can read from my fd
> using the standard stream API (otherwise I can try to use UFFI for read)
> regards
>         holger

Reply via email to