fterm -- Terminal File Test

SYNOPSIS

 #include <lcio.h>

 int fterm(FILE *f);
 

DESCRIPTION

fterm returns an indication of whether or not the stream associated with the FILE object addressed by f is assigned to an interactive terminal.

fattr contains the functionality of fterm in addition to other capabilities and is a better choice in most cases.

RETURN VALUE

fterm returns 0 for a nonterminal FILE. The fterm function returns a nonzero value if the FILE is assigned to a TSO, CMS, or OpenEdition terminal.

EXAMPLE

  #include <lcio.h>
  #include <stdio.h>

  main()
  {
     int k;
     k = fterm(stdout);

     if (k == 0)
        puts("File 'stdout' is not assigned to an interactive "
                "terminal.");
     else
        puts("File 'stdout' is assigned to an interactive terminal.");
  }

 

RELATED FUNCTIONS

fattr, fopen, isatty

SEE ALSO


Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.