[plt-scheme] Re: ssh/sftp library in mzscheme
On Mar 5, Jaime Vargas wrote:
> It will be nice to have planet module that supports to libssh.
> However, Eli's recommendation of using a subprocess works.
> Yesterday, I tried the below quick-and-dirty code using v4. I have
> two questions:
>
> 1. Process doesn't allocate a tty, so the code below only works if
> you have a public key. Is there a way to force a tty?
If you *really* want to send a password through Scheme (which sounds
like a bad idea), then you'll need to deal with creating a pty/tty
pair etc. (I tried a quick hack, but getting ssh to work is tricky.)
> 2. What is the best way start reading the response, using sleep is
> obviously ugly?
You should use a thread that reads the process's output -- but it
might be tricky to distinguish your shell's prompt from process
output. The way I'd do this is to simply run mzscheme in the remote
machine, then hack up some simple way to invoke a process through that
scheme and get the results back.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://www.barzilay.org/ Maze is Life!