Subject: [clisp-list] (ext:run-program) newbie having problems

From: "M.K." <[email-masked]>
Date: Fri Jun 27 23:20:02 2003

Hi, I am having trouble reading from the I/O stream created when I run
/bin/ftp on my linux system. This is what I am doing:

(setq iostm (ext:run-program "/bin/ftp" :input :stream :output :stream))

iostm => #<IO TWO-WAY-STREAM>

When I try to (read-char iostm) it just hangs. Given that the ftp program
normally presents stdout with the prompt "ftp> ", I was expecting to see #\f
as the first char.

Would appreciate some help,

Thanks, M.K.

---

From: Arseny Slobodjuck <[email-masked]>
Date: Sat Jun 28 18:51:08 2003

Hello M.K.,

> (setq iostm (ext:run-program "/bin/ftp" :input :stream :output :stream))

iostm =>> #<IO TWO-WAY-STREAM>

> normally presents stdout with the prompt "ftp> ", I was expecting to see #\f
I think ftp program detects whether its input stream is terminal and
prints a prompt only if it is. Try this:

file zz1:
help
quit

ftp < zz1 > zz2

results in file zz2 without any prompts in it.

-- 
Best regards,
 Arseny

---

From: "John K. Hinsdale" <[email-masked]>
Date: Sun Jun 29 05:59:10 2003

> /bin/ftp on my linux system. This is what I am doing:

I know this is not directly in resposne to your question, however if
you are running /bin/ftp as a subprocess with the intent of having
your Lisp program act as an FTP client (send and retrieve files)
you're better off speaking to the FTP server directly using the FTP
protocol.

I did a quick check for FTP client libraries for Common Lisp; this one
from Mathhew Danish looks good, but might need a little porting from
Allegro-specific calls:

   http://www.mapcar.org/~mrd/cl-ftp/

The advantage of speaking FTP directly is that you are not dependent
on the system having a human-oriented interactive FTP client that
behaves a certain way.  (E.g. the FTP client on Windows vs. Linux
behave differently in how they prompt).  The protocol is standard.

Hope this helps ...

---
John Hinsdale, Alma Mater Software, Inc., Tarrytown, NY 10591-3710 USA
[email-masked] | http://www.alma.com/staff/hin | +1 914 631 4690

---

From: Sam Steingold <[email-masked]>
Date: Mon Jun 30 06:28:09 2003

> * In message <[email-masked]>
> * On the subject of "Re: [clisp-list] (ext:run-program) newbie having problems"
> * Sent on Sun, 29 Jun 2003 08:58:20 -0400
> * Honorable "John K. Hinsdale" <[email-masked]> writes:
>

see also CLOCC/CLLIB/net.lisp
<http://www.podval.org/~sds/data/cllib.html>

> behave differently in how they prompt).  The protocol is standard.

indeed.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
The only intuitive interface is the nipple.  The rest has to be learned.