blob: 25ae9b0b2d3e5f82774e951c9620a7b019a083f4 [file] [log] [blame] [raw]
#include <windows.h>
// To avoid stack corruptions
typedef struct {
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD dwVolumeSerialNumber;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
DWORD nNumberOfLinks;
DWORD nFileIndexHigh;
DWORD nFileIndexLow;
//#ifdef _WIN32_WCE
DWORD dwOID; // Newer version of Windows CE have this member
//#endif
} BY_HANDLE_FILE_INFORMATION_NEW;
int isatty(int fd) {
BY_HANDLE_FILE_INFORMATION_NEW information;
if(fd == -1) return 0;
return !GetFileInformationByHandle((void *)fd, (BY_HANDLE_FILE_INFORMATION *)&information);
}