Hi Holger,

I took some the AttacheableFileStream from OSProcess and I changed it a bit
for OSSubprocess. If you load OSSubprocess into Pharo 5.0 [1] you can try
the following:

| reader |
reader := OSSAttachableFileStream name:'myStream' attachTo: aFileID
writable: false.
reader setNonBlocking "optional"

Then you can read via #upToEnd (or any of StandardFileStream, as
OSSAttachableFileStream is a subclass). I hope with this you can solve b).
I still didn't understand why do you mean with a). What do you mean by
"monitor it from being readable" ?

I think you could dig a bit in OSSPipe, OSSAttachableFileStream and their
usage. All classes have class comments, all methods are also documented,
and there is quite some documentation in [1].

Let me know how it goes.


On Tue, Sep 20, 2016 at 3:26 PM, Holger Freyther <hol...@freyther.de> wrote:

> 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