Command Prompt for Windows




istextfile, iswtextfile, iswtextfile

int istextfile(char *path);
int iswtextfile(wchar_t *path);
int isttextfile(TCHAR *path);

Determine whether the specified file contains text.

Parameter Description
path Address of a NULL terminated character string containing the path of a filename. This path can be relative or absolute and can not contain wildcard characters.

Returns

TRUE when the specified file is a text file, otherwise FALSE is returned. On error -1 is returned.

Comments

On error istextfile() does NOT display an error message.

Function istextfile() checks the first 100 bytes of the specified file to determine if it is a text file or not.