From: Christopher C. Stacy
Subject: Lispworks vs. pipes
Date: 
Message-ID: <umzy35br3.fsf@news.dtpq.com>
Does a program started by WIN32::OPEN-PIPE receive as stdin
what you write on the "two-way pipe"?  I can successfully read
output coming from the program, but I can't seem to shove any
input down there.

Or, is there another way I should be doing this sort of thing?

I really, really don't want to use temporary files for doing
this communication.

From: Jeff
Subject: Re: Lispworks vs. pipes
Date: 
Message-ID: <Hk7hd.337698$3l3.157604@attbi_s03>
Christopher C. Stacy wrote:

> Does a program started by WIN32::OPEN-PIPE receive as stdin
> what you write on the "two-way pipe"?  I can successfully read
> output coming from the program, but I can't seem to shove any
> input down there.

I haven't used Lispworks to do this yet, but having implemented it in
C++ numerous times, perhaps this little tidbit might help:

There are actually 3, 2-directional pipes (stdout, stdin, stderr) that
need to be redirected. Each one has a read and write end. One end is
used by the spawning process and the other is used by the spawned
process. It seems as though the pipe you are currently redirecting is
stdout. Assuming process A is your original and B is spawned with
redirected IO:

STDOUT/STDERR
 read-end  -> Process A
 write-end -> Process B

STDIN
 read-end  -> Process B
 write-end -> Process A

Hope this helps,
 Jeff M.

-- 
`(:mail-to ,(concatenate 'string (symbol-name 'massung) 
                                 (string (code-char 64)) 
                                 (string-upcase "gmail.com")))
From: Christopher C. Stacy
Subject: Re: Lispworks vs. pipes
Date: 
Message-ID: <u1xfe5i0r.fsf@news.dtpq.com>
"Jeff" <·······@gmail.com> writes:

> Christopher C. Stacy wrote:
> 
> > Does a program started by WIN32::OPEN-PIPE receive as stdin
> > what you write on the "two-way pipe"?  I can successfully read
> > output coming from the program, but I can't seem to shove any
> > input down there.
> 
> I haven't used Lispworks to do this yet, but having implemented it in
> C++ numerous times, perhaps this little tidbit might help:
> 
> There are actually 3, 2-directional pipes (stdout, stdin, stderr) that
> need to be redirected. Each one has a read and write end.

Yes; hence my question about whether the (undocumented, but only
available) Lispworks function, which returns something called a
"two-way pipe", has returned a pipe with two ends or a composite
object that has two pipes (one for stdin and one for stdout).  

In other (Win32) words, I don't know what this function is doing to
the PROCESS_INFORMATION structure that it is passing to CreateProcess,
and how that interacts with the fd/handle management/interrupt code in 
the main program of Lispworks.
From: Edi Weitz
Subject: Re: Lispworks vs. pipes
Date: 
Message-ID: <u3bzuyriu.fsf@agharta.de>
On Mon, 01 Nov 2004 04:07:32 GMT, ······@news.dtpq.com (Christopher C. Stacy) wrote:

> Yes; hence my question about whether the (undocumented, but only
> available) Lispworks function, which returns something called a
> "two-way pipe", has returned a pipe with two ends or a composite
> object that has two pipes (one for stdin and one for stdout).
>
> In other (Win32) words, I don't know what this function is doing to
> the PROCESS_INFORMATION structure that it is passing to
> CreateProcess, and how that interacts with the fd/handle
> management/interrupt code in the main program of Lispworks.

Have you looked at the documented and exported function
SYSTEM:OPEN-PIPE? Isn't that the same thing?

BTW, I guess you'll get better answers on the LW mailing list.

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Christopher C. Stacy
Subject: Re: Lispworks vs. pipes
Date: 
Message-ID: <ufz3u3qct.fsf@news.dtpq.com>
Edi Weitz <········@agharta.de> writes:

> On Mon, 01 Nov 2004 04:07:32 GMT, ······@news.dtpq.com (Christopher C. Stacy) wrote:
> 
> > Yes; hence my question about whether the (undocumented, but only
> > available) Lispworks function, which returns something called a
> > "two-way pipe", has returned a pipe with two ends or a composite
> > object that has two pipes (one for stdin and one for stdout).
> >
> > In other (Win32) words, I don't know what this function is doing to
> > the PROCESS_INFORMATION structure that it is passing to
> > CreateProcess, and how that interacts with the fd/handle
> > management/interrupt code in the main program of Lispworks.
> 
> Have you looked at the documented and exported function
> SYSTEM:OPEN-PIPE? Isn't that the same thing?

That's not documented API in the version of Lispworks I have.
(Maybe they renamed it and decided to document it in a later
release, or maybe that new interface just applies to Unix.)
From: Edi Weitz
Subject: Re: Lispworks vs. pipes
Date: 
Message-ID: <ud5yxyexp.fsf@agharta.de>
On Mon, 01 Nov 2004 08:50:26 GMT, ······@news.dtpq.com (Christopher C. Stacy) wrote:

> That's not documented API in the version of Lispworks I have.
> (Maybe they renamed it and decided to document it in a later
> release, or maybe that new interface just applies to Unix.)

From the docs it seems it applies to all supported platforms for the
4.3 release:

  <http://www.lispworks.com/reference/lw43/LWRM/html/lwref-524.htm>

Maybe you'll have to upgrade...

Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")