From: Marcin Tustin
Subject: Forking and spawning processes
Date: 
Message-ID: <9i7dko$1h3$1@newsg3.svr.pol.co.uk>
    I'm writing an app that needs to execute external programs, and then
exit, while at least one of those others is still running. They may not be
written in lisp. Are there any libraries for this (Can't see anything in the
spec.)

Thanks.

From: Christopher Stacy
Subject: Re: Forking and spawning processes
Date: 
Message-ID: <u4rsomlmh.fsf@spacy.Boston.MA.US>
>>>>> On Sat, 7 Jul 2001 17:33:40 +0100, Marcin Tustin ("Marcin") writes:
 Marcin>     I'm writing an app that needs to execute external programs, and then
 Marcin> exit, while at least one of those others is still running. They may not be
 Marcin> written in lisp. Are there any libraries for this (Can't see anything in the
 Marcin> spec.)

It's not clear from your message exactly what functionality you need,
but it sounds like maybe what you are asking is for your Lisp program
to launch some additional programs (and then exit).

Common Lisp (the language) does not cover this, but all of the
implementations of Common Lisp include an extension of some sort or
another that provides what you are looking for.  You can trivially run
external programs simply (communicating over a stream), or you can in
various fashions link with arbitrary "foreign" programs and use system APIs.
All of these things are platform dependant; in order to get more information,
you'll need to say what Lisp implementation you are using, what operating
system you are on, and more exactly what it is that you want to do.

Since there seem to be several pieces involved, you should also
consider whether Lisp necessarily needs to be the central control
nexus of the application.  There might or might not be easier ways
of arranging things.
From: Peter Wood
Subject: Re: Forking and spawning processes
Date: 
Message-ID: <80bsmvu5na.fsf@localhost.localdomain>
"Marcin Tustin" <·······@GUeswhatthisbitisfor.mindless.com> writes:

>     I'm writing an app that needs to execute external programs, and then
> exit, while at least one of those others is still running. They may not be
> written in lisp. Are there any libraries for this (Can't see anything in the
> spec.)

Hi

If you are using Linux and Clisp with the bindings for libc6, you can
use (linux:fork) to do this.

Regards,
Peter
From: Peter Wood
Subject: Re: Forking and spawning processes
Date: 
Message-ID: <80lmlz4tb5.fsf@localhost.localdomain>
Peter Wood <··········@worldonline.dk> writes:

> "Marcin Tustin" <·······@GUeswhatthisbitisfor.mindless.com> writes:
> 
> >     I'm writing an app that needs to execute external programs, and then
> > exit, while at least one of those others is still running. They may not be
> > written in lisp. Are there any libraries for this (Can't see anything in the
> > spec.)
> 
> Hi
> 
> If you are using Linux and Clisp with the bindings for libc6, you can
> use (linux:fork) to do this.
> 
> Regards,
> Peter

I forgot to say that (run-program ...) also accepts a keyword argument
:wait (default is t) which determines wether to wait for the external
program to finish before continuing.
From: Marcin Tustin
Subject: Re: Forking and spawning processes
Date: 
Message-ID: <9i9nnt$o96$1@news6.svr.pol.co.uk>
Peter Wood <··········@worldonline.dk> wrote in message
···················@localhost.localdomain...
> Peter Wood <··········@worldonline.dk> writes:
>
> > "Marcin Tustin" <·······@GUeswhatthisbitisfor.mindless.com> writes:
> >
> > >     I'm writing an app that needs to execute external programs, and
then
> > > exit, while at least one of those others is still running. They may
not be
> > > written in lisp. Are there any libraries for this (Can't see anything
in the
> > > spec.)
> >
> > Hi
> >
> > If you are using Linux and Clisp with the bindings for libc6, you can
> > use (linux:fork) to do this.
> >
> > Regards,
> > Peter
>
> I forgot to say that (run-program ...) also accepts a keyword argument
> :wait (default is t) which determines wether to wait for the external
> program to finish before continuing.

    Thanks - may have to do that, although I am looking for a method
portable across Common Lisp implementations - doesn't CL have a posix
binding ?
From: Christopher Stacy
Subject: Re: Forking and spawning processes
Date: 
Message-ID: <ubsmvavys.fsf@spacy.Boston.MA.US>
>>>>> On Sun, 8 Jul 2001 14:38:19 +0100, Marcin Tustin ("Marcin") writes:
 Marcin> I am looking for a method portable across Common Lisp implementations - 
 Marcin> doesn't CL have a posix binding ?

ANSI Common Lisp does not define one.
From: Thomas F. Burdick
Subject: Re: Forking and spawning processes
Date: 
Message-ID: <xcv4rsn2dve.fsf@apocalypse.OCF.Berkeley.EDU>
Christopher Stacy <······@spacy.Boston.MA.US> writes:

> >>>>> On Sun, 8 Jul 2001 14:38:19 +0100, Marcin Tustin ("Marcin") writes:
>  Marcin> I am looking for a method portable across Common Lisp implementations - 
>  Marcin> doesn't CL have a posix binding ?
> 
> ANSI Common Lisp does not define one.

Or, more usefully, POSIX did not define bindings for Lisp.
From: Kent M Pitman
Subject: Re: Forking and spawning processes
Date: 
Message-ID: <sfw3d86hl3j.fsf@world.std.com>
···@apocalypse.OCF.Berkeley.EDU (Thomas F. Burdick) writes:

> Christopher Stacy <······@spacy.Boston.MA.US> writes:
> 
> > >>>>> On Sun, 8 Jul 2001 14:38:19 +0100, Marcin Tustin ("Marcin") writes:
> >  Marcin> I am looking for a method portable across Common Lisp implementations - 
> >  Marcin> doesn't CL have a posix binding ?
> > 
> > ANSI Common Lisp does not define one.
> 
> Or, more usefully, POSIX did not define bindings for Lisp.

Uh, actually, I think it can be done either way.

I'm pretty sure the ANSI Lisp design committee, J13, could spawn a 
subgroup to do posix bindings if it wanted to.
From: Barry Margolin
Subject: Re: Forking and spawning processes
Date: 
Message-ID: <A9m27.32$1B3.1321@burlma1-snr2>
In article <···············@world.std.com>,
Kent M Pitman  <······@world.std.com> wrote:
>I'm pretty sure the ANSI Lisp design committee, J13, could spawn a 
>subgroup to do posix bindings if it wanted to.

They could.  Traditionally, however, it seems more common for the standards
committee for a particular application area (e.g. graphics, an operating
system, etc.) to define the bindings in various languages.  But whether
they'll bother for a particular language depends on its popularity among
the constituency of that application area.  If a large number of CL users
also use POSIX, but they're a tiny fraction of the overall POSIX programmer
community, the POSIX committee isn't likely to consider a CL binding to be
as high priority as the CL committee would.

-- 
Barry Margolin, ······@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.