[Gambas-user] Gambas 3 advancement
Doriano Blengino
doriano.blengino at ...1909...
Tue Dec 21 20:14:16 CET 2010
Benoît Minisini ha scritto:
>> Benoît Minisini ha scritto:
>>
>>>> Pipes should not return EOF when the pipe is not closed. But they should
>>>> return EOF when the other side closes.
>>>>
>>> Why ?
>>>
>> Because this is the way *all* unix routines work, and the only logical one.
>>
>>
> You get a point, but Eof() in Gambas does not actually mean what EOF means in
> Unix.
>
> I had only one Basic syntax for that, and I need to know if there is something
> to read on a stream, and I used Eof() for that.
>
> For a file stream, the two meanings are the same. But not for a pipe or a
> socket.
>
> At the moment, for a pipe or a socket, you get an error when it is closed.
>
> Note that for a socket, "there is date to read" does not mean the same thing
> than for a pipe, because there is the network between two sides of a socket.
>
(Readed the following mail too...) What do you mean?
> I will try to change the meaning of Eof() to match the Unix one, and see how
> many things break.
>
> And I will keep the meaning of Lof(), so that Lof() = 0 means that there is
> nothing to read, even if the new Eof() is False.
>
The solution seems perfect. In the old days of basic, lof() was used on
serial lines to see if there were data to read.
Regards,
Doriano
More information about the User
mailing list