From: Pascal Bourguignon
Subject: Re: clisp, cygwin, a2ps, and ext:run-program
Date: 
Message-ID: <877jhxy1p4.fsf@thalassa.informatimago.com>
"Ben" <·····@yahoo.com> writes:

> I'm still new to lisp, but I'm writing a few tools to use at work.  I'm
> running into some funny problems with clisp's ext:run-program
>
> I have a program that creates a temp file and dumps a bunch of stuff to
> it.  Then I print it using ext:run-program.  Then I delete the temp
> file and exit.
>
> The problem is that the lisp program is exiting before a2ps.  I'm not
> sure why.  I pass :wait t to run-program, and I (mis?)understood from
> the documentation that this forced synchronous operation.  I am having
> the same problem with other calls, but since I am setting :output
> :stream on those, it isn't such a big deal - it works anyway.  I do
> worry I could run into weird problems there to.
>
> Am I doing something wrong?

How are you printing?  Sometimes, lpr doesn't take immediately a copy
of the file to be printed, but just refer it when it needs it later.
So if you delete it immediately after running lpr, it won't be able to
print it.  Note that you could use lpr -r to have the file be deleted
by lpr once printed.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
The mighty hunter
Returns with gifts of plump birds,
Your foot just squashed one.

From: Ben Belly
Subject: Re: clisp, cygwin, a2ps, and ext:run-program
Date: 
Message-ID: <1116421503.668865.11440@o13g2000cwo.googlegroups.com>
>How are you printing?  Sometimes, lpr doesn't take immediately
>a copy of the file to be printed, but just refer it when it needs
> it later.  So if you delete it immediately after running lpr, it
won't
> be able to print it.  Note that you could use lpr -r to have the
> file be deleted by lpr once printed.

Thanks.  That's a good point, and something to watch out for.  However,
I am seeing the terminal output from a2ps AFTER the program has exited.

Oops.  I just double checked, and I am sending the output to a stream
in the call to a2ps too.  I guess that's my problem.  Sorry to waste
your time.

I am a little surprised that ext:run-program disregards the :wait
directive just because output is a stream, but since I'm new there is
probably some rule about streams or some other detail I'm missing.

Thanks again.

-Ben
From: Sam Steingold
Subject: Re: clisp, cygwin, a2ps, and ext:run-program
Date: 
Message-ID: <ull6cwsh7.fsf@gnu.org>
> * Ben Belly <········@tznvy.pbz> [2005-05-18 06:05:03 -0700]:
>
> I am a little surprised that ext:run-program disregards the :wait
> directive just because output is a stream, but since I'm new there is
> probably some rule about streams or some other detail I'm missing.

when you want to talk to your subprocess via a pipe, :wait has to be
ignored because the pipes are valid only while the other end is alive.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.honestreporting.com> <http://www.openvotingconsortium.org/>
<http://www.dhimmi.com/> <http://www.jihadwatch.org/> <http://www.memri.org/>
cogito cogito ergo cogito sum