[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
isatty()                 Check for Character Device

 #include   <io.h>

 int        isatty(handle);
 int        handle;                      Handle of the device being tested

    isatty() checks whether 'handle' is associated with a character
    device (i.e., a terminal, console, printer, or serial port).

    Returns:    Non-zero if 'handle' is associated with a device;
                otherwise zero.

  -------------------------------- Example ---------------------------------

    The following statements determine if 'fhndl' is associated with a
    character device. If not, they get the file pointer position.

          #include <io.h>

          int fhndl;
          long position;

          main()
          {
                fhndl = open("data",O_RDWR);
                if (isatty(fhndl) == 0)
                   position = tell(fhndl);
           }

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson