[Sbcl-help] broken pipe to gnuplot

61 views
Skip to first unread message

Mirko Vukovic

unread,
Nov 16, 2012, 5:26:59 PM11/16/12
to sbcl...@lists.sourceforge.net
I am trying to launch a gnuplot process and send commands to it. But
I get a broken pipe.
Here is an example.

This will get gnuplot going

(setf
*gnuplot*
(external-program:start *executable* '("-persist" "-e" "plot sin(x)")
:input :stream
:output :stream)
*gnuplot-input* (sb-ext:process-input *gnuplot*)
*gnuplot-output* (sb-ext:process-output *gnuplot*))

Now I try to quit:

(format *gnuplot-input* "quit~%")
(finish-output *gnuplot-input*)

After the last command I get broken pipe.

This example is a bit academic. In general, I want to send other
plotting commands, not to quit.

Is that possible?

Thanks,

Mirko

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Sbcl-help mailing list
Sbcl...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help

Stelian Ionescu

unread,
Nov 16, 2012, 5:42:26 PM11/16/12
to sbcl...@lists.sourceforge.net
On Fri, 2012-11-16 at 17:26 -0500, Mirko Vukovic wrote:
> I am trying to launch a gnuplot process and send commands to it. But
> I get a broken pipe.
> Here is an example.
>
> This will get gnuplot going
>
> (setf
> *gnuplot*
> (external-program:start *executable* '("-persist" "-e" "plot sin(x)")
> :input :stream
> :output :stream)
> *gnuplot-input* (sb-ext:process-input *gnuplot*)
> *gnuplot-output* (sb-ext:process-output *gnuplot*))
>
> Now I try to quit:
>
> (format *gnuplot-input* "quit~%")
> (finish-output *gnuplot-input*)
>
> After the last command I get broken pipe.
>
> This example is a bit academic. In general, I want to send other
> plotting commands, not to quit.
>
> Is that possible?

If you start it with "-e", gnuplot goes into batch mode and does not
accept commands from stdin, ergo the EPIPE.

--
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.
http://common-lisp.net/project/iolib

signature.asc
Reply all
Reply to author
Forward
0 new messages