[Gambas-user] Problem with Process_Read

Benoît Minisini gambas at ...1...
Sun Nov 30 19:33:55 CET 2014


Le 30/11/2014 19:10, Jussi Lahtinen a écrit :
>> OK, I finally got one error (but 239), even if I replaced "Wait 0.1" by
>> "hProcess.Wait". Let's go back investigating...
>>
>
> I'll make the change in the code. "Good" to see it's not fault in my system.
>
>
> Jussi

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...

-- 
Benoît Minisini




More information about the User mailing list