[Gambas-user] Problem with Process_Read

Jussi Lahtinen jussi.lahtinen at ...626...
Sun Nov 30 19:40:23 CET 2014


>
> At the moment I can get the 239 error, i.e. when running 'echo test'
> through a virtual terminal.
>
> In Linux, you have a system call that tells you how many bytes can be
> read on a file descriptor: ioctl(fd, FIONREAD, ...), and a system call
> (select) that tells you when something can be read on a file descriptor.
>
> Apparently, the system tells me that there is something to read, but the
> ioctl(fd, FIONREAD...) tells me that there is zero bytes!
>
> At the end of the child process, I use that to know if there is still
> something to read from its output. And as I receive zero, I return a
> void string. If the data from 'echo test' arrives before the process
> ends, everything works as expected.
>
> Strange...
>

I tested if this happens also with "cat" and it didn't make any difference.
Hmmm... maybe there is some other system function to check a file
descriptors.


Jussi



More information about the User mailing list