[Gambas-user] Pipe doesn't receive contents
Doriano Blengino
doriano.blengino at ...1909...
Sat May 8 20:38:13 CEST 2010
Benoît Minisini ha scritto:
>
> Well, in a few words, don't mix the behaviour of Gambas, the C library and the
> Linux kernel!
>
So you are true. If someone says that tail(1) does not work with pipes,
because eof has no meaning, he is right. If someone else demonstrates
that it works, is wrong. Eof ("End-Of-File": E.nd O.f F.ile) in gambas
does not mean the same thing as the rest of the world - in gambas it
means "I can not read right now, you fool!". Who cares about C library
and kernel, gambas does not use them, right? Anyway, in the system (and
I bet in most languages), Eof means the same thing, always, no matter if
coping with files, pipes, sockets, serial terminals and so on. This is
the beauty of unix. In Gambas, Eof is good for true files; but not for
pipes. For sockets, let me see a moment. For stdin, it depends: if it is
a file, one thing; if it is a pipe, another thing; if it is a terminal,
let me take a look (just a moment, you see, I use buffered non-blocking
asynchronous sparse multi-line I/O and this is a complicated matter, it
is not so simple like those stupid unix commands which, I don't know
how, can run every aspect of a big unix system).
Sorry for the irony - take it with a smile (just a little english
humor). I see your point, but perhaps you should explain better at
first, without misleading phrases, and not at the end, after arguing to
someone (me) which, unfortunately, has often different ideas than you.
After all, gambas is not the only thing in the world - if it does some
thing differently than what one expects, or differently from other,
important systems, some explanation can be useful. Our friend Rolf did
the most common sense thing everyone would do: use eof() to catch the
end of a stream. Then, two different persons said that the problem was
the pipe. It is not the pipe. It is that gambas treats pipes differently
than regular files. This is the thing to point out. You are also
entitled to say that it is a unix fault, that pipes are not files, you
can say whatever you want. But as long as gambas runs on unix, and uses
the C library, you must point out the differences about the underlying
system. Or not? It's your choice.
Regards,
Doriano
More information about the User
mailing list