Re: Detecting a PIPE in a program

From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 02/03/05


Date: Thu, 03 Feb 2005 01:54:13 GMT

Richard Bos wrote:
> CBFalconer <cbfalconer@yahoo.com> wrote:
>
>> /* This is very likely to be non-portable */
>> /* DOES NOT check fp open for reading */
>> /* NULL fp is considered a keyboard here! */
>> static int akeyboard(FILE *fp)
>> {
>> #ifndef __TURBOC__
>> # ifdef __STDC__
>> /* This dirty operation allows gcc -ansi -pedantic */
>> extern int fileno(FILE *fp);
>> extern int isatty(int fn);
>
> Only "very likely" to be non-portable?

Yup, in the sense that it has a finite chance of failing on your
conforming system. Would you rather I claimed it to be portable,
or didn't even mention it?

-- 
"If you want to post a followup via groups.google.com, don't use
 the broken "Reply" link at the bottom of the article.  Click on 
 "show options" at the top of the article, then click on the 
 "Reply" at the bottom of the article headers." - Keith Thompson


Relevant Pages

  • Re: Detecting a PIPE in a program
    ... in the sense that it has a finite chance of failing on your ... > conforming system. ... but I could be wrong; that's the danger of non-portable code ...
    (comp.lang.c)
  • Re: Detecting a PIPE in a program
    ... in the sense that it has a finite chance of failing on your ... > conforming system. ... Lawrence ...
    (comp.lang.c)
  • Re: OT: why do countries become democracies?
    ... You might take a look at "The bottom billion, Why the Poorest Countries ... Are Failing and What Can Be Done About It" by Paul Collier. ...
    (talk.origins)
  • Re: Registering MSDN Professional
    ... I suspect your product relates to the Open column here? ... perhaps (failing all else) try the "Contact Us" at the ... bottom of the page... ... Marc ...
    (microsoft.public.dotnet.general)
  • Re: flatulent-0.0.3
    ... but it's still failing ... note the new output - sample at bottom of above post. ... Testing with an updated flatulent version is cheating;) ... Jannis Harder ...
    (comp.lang.ruby)