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 last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster