[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems with INTERACTIVE-STREAM-P



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