Bugs item #428180, was updated on 2001-05-28 19:49
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=110493&aid=428180&group_id=10493
Category: run-time
Group: None
>Status: Closed
>Resolution: Works For Me
Priority: 5
Submitted By: Brian D. Carlstrom (bdc)
Assigned to: Olin Shivers (olin-shivers)
Summary: connecting a string port to a process
Initial Comment:
From: Allyn Dimock <dimock@deas.harvard.edu>
Cc: "Brian D. Carlstrom" <bdc@ai.mit.edu>, "Olin
Shivers" <shivers@ai.mit.edu>,
"Allyn Dimock" <dimock@deas.harvard.edu>
Subject: in scsh: can you connect a string port to a
process?
Date: 13 Jan 2000 17:16:08 -0500
The following message is a courtesy copy of an article
that has been posted as well.
In scsh: can you connect a string port to a process?
I am looking to feed a computed string (a C-shell
script) to a
process, and was trying to see if I could get away
without first
writing it to a file.
the code
(define main
(lambda ()
(let* (...
(input ...)
(input-as-port (make-string-input-port
input)))
(run (/bin/csh)
(= 0 ,input-as-port)
(= 2 1)))))
fails with
Error: Not a file descriptor or fdport.
#{Extensible-input-port}
Writing out to a file and (run (/bin/csh)
(< ,tmpfile)) works [of course].
Is there a way in scsh to feed text directly to the
stdin of another
process?
-- Allyn
----------------------------------------------------------------------
>Comment By: Olin Shivers (olin-shivers)
Date: 2001-05-29 09:25
Message:
Logged In: YES
user_id=101304
This is an important feature, and scsh supports it. Use the
<< redir.
In your example,
(run (cat) (<< ,input))
Converting it to a port -- you're working too hard.
(Scsh implements this by forking off a subprocess that
writes the bits
down a pipe.)
-Olin
----------------------------------------------------------------------
Comment By: Brian D. Carlstrom (bdc)
Date: 2001-05-28 19:52
Message:
Logged In: YES
user_id=27364
A slightly simpler example. Obviously there is no real file
descriptor underneath. One could use a unix domain socket
on unix (but not win32 at the moment) or a plain socket or
perhaps a ptty or something odd.
Do we want to do this automatically?
Scsh 0.5.3
> (run ("cat") (= 0 ,(make-string-input-port "")))
Error: Not a file descriptor or fdport.
#{Extensible-input-port}
256
>
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=110493&aid=428180&group_id=10493
|