Re: What signal to send to terminate gnuplot process?

Mirko Vukovic <[email protected]> Tue, 6 Feb 2024 19:23:56 -0500
Newsgroups gmane.comp.graphics.gnuplot.user
Message-ID <CAO73BABaaeHH5zcALFxKa_-gk3Af_FvN=2GE-8nnL13TY2kU1g@mail.gmail.com>
On Tue, Feb 6, 2024 at 12:52 PM Robert Dodier <[email protected]>
wrote:

> On Sat, Feb 3, 2024 at 7:40 AM Mirko Vukovic <[email protected]>
> wrote:
>
> > I can shut down the process by sending the "exit" command.
> >
> > But I'd also like to send a signal (such as SIGTERM) to shut gnuplot
> down.
>
> Probably a cleaner and system independent way to tell gnuplot to shut
> down is just to close the socket through which commands are sent -- I
> don't know for sure, but I suspect that gnuplot will terminate if the
> socket is closed, since that is a widely used convention for
> organizing interprocess communications.
>
> Maxima (https://maxima.sourceforge.io) is a Common Lisp application
> and it has some code to work with gnuplot for plotting; see
> src/plot.lisp and src/gnuplot_def.lisp (I think those are the right
> file names) to get some ideas about how stuff was handled there.
>
>
Thanks Robert,

I looked at the Maxima source in the src/plot.lisp, and your suggestion
worked:

Doing - with apologies for non-lisp readers that the parenthesis may
confuse -

(close (ccl:external-process-input-stream process-handle))

closes the process.

`process-handle' is the structure returned by the command that launches
gnuplot: (ccl:run-program "gnuplot" ...)


Mirko

_______________________________________________
gnuplot-info mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info