[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problems with INTERACTIVE-STREAM-P
- To: clisp-list@ma2s2.mathematik.uni-karlsruhe.de
- Subject: Re: problems with INTERACTIVE-STREAM-P
- From: nathan@bristol.st.com
- Date: Wed, 5 Jun 1996 09:25:03 +0100 (BST)
- In-reply-to: <9606041219.AA11530@ilog.ilog.fr> from "Bruno Haible" at Jun 4, 96 03:13:03 pm
Bruno,
> > puts T into the output file. I get the same result when I use
> > *standard-output* or *terminal-io* too.
>
> You have redirected the output to a file, but the input part of *terminal-io*
> is still referring to your terminal. This is why `interactive-stream-p'
> reports T.
Yes, this is what I'd missed, I'd assumed the unix convention of stdin, stdout
and stderr mapped to *standard-input* *standard-output* and *error-output*.
>
> You could redirect standard input from /dev/null, but unfortunately CLISP
> does not know about /dev/null's special nature. (How do you tell that
> a file descriptor is pointing to /dev/null when all you have is the file
> descriptor?)
err, isatty(3)?
Anyway I've solved my problem, with the rather inelegant solution of
(zerop (shell "tty -s 0<&1"))
nathan
--
Nathan Sidwell Holder of the Xmris home page
Chameleon Architecture Group at SGS-Thomson, formerly Inmos
http://www.pact.srf.ac.uk/~nathan/ Tel 0117 9707182
nathan@pact.srf.ac.uk or nathan@inmos.co.uk or nathan@bristol.st.com