[Gambas-user] Pipe doesn't receive contents
Benoît Minisini
gambas at ...1...
Sat May 8 14:36:07 CEST 2010
>
> First you used buffered I/O, whereas PIPE in Gambas use non-buffered I/O.
> Then you use fgetc(), which reads one character, whereas in Gambas the
> code uses LINE INPUT, which is far more complex. So you are not comparing
> the two same programs...
>
> Regards,
And the same program as you written in Gambas works too:
Dim hFile As File
Dim iChar As Byte
hFile = Pipe "/tmp/FIFO1" For Input
Print "Now let's start:";; Eof(hFile)
Do
Try iChar = Read #hFile As Byte
If Error Then
' Normally the error is "End of file"
Print Error.Text
Break
Endif
Print Chr$(iChar);
Loop
Print "That's it."
--
Benoît Minisini
More information about the User
mailing list