Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C - <b>isatty() check for character device</b> http://www.X-Hacker.org [<<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);
           }

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson