>>>>> "RT" == RT Happe <rthappe@mathematik.uni-freiburg.de> writes:
RT> I cannot write to the control terminal opened as input file, then dupped.
RT> [ Linux PC, kernel 2.2.17 ]
RT> Welcome to scsh 0.6.2 (Gambit-C 4.0) Type ,? for help.
>> (close-after (dup->outport (open-input-file (control-tty-file-name)))
RT> (lambda (op) (display 'beep op)))
RT> Error: exception
RT> os-error
RT> (channel-maybe-write '#{Byte-vector 98 101 101 112 0 0 ---} 0 4
RT> '#{Output-channel 4} "Bad file descriptor")
You have to open the file in read/write mode if you want to use it for
input and output as well:
(close-after (dup->outport (open-file (control-tty-file-name) open/read+write))
(lambda (op) (display 'beep op)))
--
Martin
|