[Openmcl-devel] popen is not happy

Erann Gat gat at flownet.com
Wed Jun 4 22:28:37 UTC 2003


On Wed, 4 Jun 2003, Erann Gat wrote:

> So to get the behavior I want I need to much with pipe() and dup() and
> fork()

That was, of course, supposed to be "muck", not "much".

And I just discovered run-program.

Bad news is that run-program seems to be buggy when used with :input
:stream or :output :stream

? (run-program "cat" nil :wait nil :output :stream :input :stream)
#<EXTERNAL-PROCESS [6240] (RUNNING) #x52A3D1E>
? (setf p *)
#<EXTERNAL-PROCESS [6240] (RUNNING) #x52A3D1E>
? (setf in (external-process-input-stream p))
#<FD-CHARACTER-INPUT-STREAM (NIL/4) #x52A3ADE>
? (setf out (external-process-output-stream p))
#<FD-CHARACTER-OUTPUT-STREAM (NIL/7) #x52A3C26>
? (format out "123~%")
NIL
? (force-output out)
> Error: Error on #<FD-CHARACTER-OUTPUT-STREAM (NIL/7) #x52A3C26> : 
>        Bad file descriptor
> While executing: CCL::FD-STREAM-FORCE-OUTPUT

---

? (run-program "ls" nil :output :stream) 
#<EXTERNAL-PROCESS [6254] (EXITED : 0) #x52A8A5E>
? (setf p *) 
#<EXTERNAL-PROCESS [6254] (EXITED : 0) #x52A8A5E>
? (external-process-input-stream p)
NIL
? (external-process-output-stream p)
#<FD-CHARACTER-OUTPUT-STREAM (NIL/9) #x52A8966>
? (listen *)
> Error: No applicable method for args:
>         (#<FD-CHARACTER-OUTPUT-STREAM (NIL/9) #x52A8966>)
>         to #<STANDARD-GENERIC-FUNCTION STREAM-LISTEN #x5090F96>
> While executing: #<CCL::STANDARD-KERNEL-METHOD NO-APPLICABLE-METHOD (T)>


E.



_______________________________________________
Openmcl-devel mailing list
Openmcl-devel at clozure.com
http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel



More information about the Openmcl-devel mailing list