[Gambas-user] getting process output reliably

Rob sourceforge-raindog2 at ...94...
Wed Aug 11 21:08:44 CEST 2004


On Wednesday 11 August 2004 14:57, Benoit Minisini wrote:
> You should not use Lof() on a process output, because there is
> no mean to know how many bytes are readable without read them.
> You should use "READ #LAST, sshLine, -256" to read, for
> example, at most 256 bytes.

Thanks, this works like a champ :)  I added it to the wiki.

> End of line is '\n', not '\r\n'. And Line input will stop if
> there is no data on the process output, even if it is not and
> end of line. Use READ as I shown just before.

My point was that there was no way to tell whether LINE INPUT has 
stripped a linefeed off of the process output or not: it's 
inconsistent behavior.  I was looking for "\r"'s because the 
system my program is connecting to usually (an operating system 
with 3 letters that begins with S, but I'm not going to name it 
:P ) sends "\r\n", but sometimes just "\r" depending on the 
program that is running.

Anyway, "READ" as above works fine, thanks :)

Rob





More information about the User mailing list