Added support for subprocesses to OPEN-CHANNEL-WRAPPER.
authorMark Friedman <edu/mit/csail/zurich/markf>
Tue, 27 Feb 1990 19:39:34 +0000 (19:39 +0000)
committerMark Friedman <edu/mit/csail/zurich/markf>
Tue, 27 Feb 1990 19:39:34 +0000 (19:39 +0000)
v7/src/runtime/io.scm

index 2e48b8a03cace0fa7aa85c5052835ec8900982fa..2bec879a461d8582069ed07904ec6e232c0fef91 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/io.scm,v 14.3 1989/09/20 15:03:59 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/io.scm,v 14.4 1990/02/27 19:39:34 markf Exp $
 
 Copyright (c) 1988, 1989 Massachusetts Institute of Technology
 
@@ -84,13 +84,17 @@ MIT in each case. |#
 ;;;    - false:  input channel
 ;;;    - 0:      closed channel
 
-(define ((open-channel-wrapper direction) filename)
+(define ((open-channel-wrapper direction) filename-or-process)
   (without-interrupts
    (lambda ()
      (let ((channel
            (make-physical-channel
-            (file-open-channel filename direction)
-            filename
+            (if (process? filename-or-process)
+                (if direction
+                    (process-get-input-channel filename-or-process)
+                    (process-get-output-channel filename-or-process))
+                (file-open-channel filename-or-process direction))
+            filename-or-process
             direction)))
        (with-absolutely-no-interrupts
        (lambda ()