Kalle Olavi Niemitalo wrote:
> Branko Cibej <brane_at_xbc.nu> writes:
>
>
>> I think trying the "isatty" way is a good idea. There's no need to
>> embarrass script writers unless absolutely necessary.
>>
>> Portability could be an issue (Windows, Windows, give me your answer, do
>> ...) but it can't be worse than the other command-line bits, and we
>> already have a cmdline.c that's full of Win-specific ifdefs.
>>
>
> On Windows, there is GetFileType in Win32 and _isatty in CRT.
> http://msdn.microsoft.com/library/aa364960.aspx
> http://msdn.microsoft.com/library/f4s0ddew.aspx
>
> apr_file_info_get calls GetFileType and the source looks like it
> sets APR_CHR in the appropriate situations. It requires an
> apr_file_t * but apr_file_open_stdout can apparently provide one.
>
We're already doing WinAPI calls in cmdline.c. No need to mix this up
with APR.
(Also "character device" and "tty" are sorta like, y'know, not quite the
same thing.)
-- Brane
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1475258
Received on 2009-03-30 01:31:00 CEST