Public Comment Number PC-UK0090 ISO/IEC CD 9899 (SC22N2620) Public Comment =========================================== Date: 1998-02-25 Author: N.M Maclaren Author Affiliation: Self Postal Address: University of Cambridge, Computer Laboratory, New Museums Site, Pembroke Street, Cambridge CB3 3QG, United Kingdom E-mail Address: Telephone Number: +44 1223 334761 Fax Number: +44 1223 334679 Number of individual comments: 1 Comment 1. Category: Feature that should be included Committee Draft subsection: 7.13.5 Title: Determining whether a stream is interactive Detailed description: An old problem with the C library is that some essential functions in the base document operated on Unix file descriptors and not streams. Most of these have been added to C in 'stream' form, but isatty() has not. This is a serious omission as it means that there is no way for a portable program to determine whether a stream is 'interactive' or not, despite the fact that such semantics are defined in 7.13.3 Files. The following specification has been implemented several times, under both MVS and Unix, and probably other systems. I suggest adding something like the following: 7.13.5.7 The fisatty function Synopsis 1 #include int fisatty(FILE *stream) Description 2 The fisatty function indicates whether the stream refers to an interactive device, in the sense used by section 7.13.3 to determine whether a stream is opened fully buffered or not. Returns 3 The fisatty function returns a nonzero value if and only if the stream can be determined to refer to an interactive device. [ Incidentally, this state can change during the lifetime of a stream under MVS and some other systems, but I suggest ignoring that little nasty! The above wording should be adequate for both the changing and normal cases. ]