[Lazarus] Lazarus International Games Contest

Antônio antoniog12345 at gmail.com
Mon Oct 19 19:13:58 CEST 2009


sethdgrover at gmail.com wrote:

Hi guys. Many thanks your answers.

> If you need to execute commands and get the output, I recommend
> learning how to use TProcess and simply use it to execute /usr/bin/ssh
> to connect to the remote machine using non-interactive, key-based
> authentication

I have tried to use the TProcess example on Lazarus web site and it is
not working with some type of executable files. For example it is
working with 'ping' but not with 'ls' or 'dir'.
I have tried also with 'ssh' but I didn't had a passwordless setting
back then. Now I have a passwordless ssh. I will try again. Maybe it
works.


> and collect the output using the TProcess' pipes.
> I work on a product that uses this method to communicate with other devices via SSH and it works very well.

You run a program via SSH and then exit?
In my case I need to constantly read the output produced by TProcess
because my SSH session is not just running once and then finishes. It
continuosly produces output as I start new programs in it.

The example for TProcess shows ho to read the output directly from
memory via streams, but as I told you it doesn't work with 'static'
programs - programs that are genereting output just once and then exit
(like ls).




More information about the Lazarus mailing list