Borland C++ reference

isatty

raw OCR

Checks for device type.

Defined in header <io.h>

Syntax

#include <io.h>
int isatty(int handle);

Portability

DOSUNIXWindowsANSI CC++ only
■■■

Remarks

isatty determines whether handle is associated with any one of the following character devices:

□ a terminal a a console a a printer D a serial port

Return value

If the device is a character device, isatty returns a nonzero integer. If it is not such a device, isatty returns 0.

Example

#include <stdio.h>
#include <io.h>

int main(void)
{
   int handle;
   handle = fileno(stdprn) ;
   if (isatty (handle))
      printf("Handle %d is a  device type\n", handle);
   else
      printf("Handle %d isn't  a device type\n", handle);
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.