set the translation mode (not useful under QNX)
#include <unistd.h> #include <fcntl.h> int setmode( int filedes , int mode );
The setmode() is provided for compatibility with other systems. setmode() performs no useful action under QNX .
setmode() always returns O_BINARY under QNX . This manifest is defined in the fcntl.h header file.
chsize(), close(), creat(), dup(), dup2(), eof(), exec... functions, fcntl(), filelength(), fileno(), fstat(), isatty(), lseek(), open(), read(), sopen(), stat(), tell(), umask(), write()
#include <stdio.h> #include <fcntl.h> #include <unistd.h> void main() { FILE *fp; long count; fp = fopen( "file", "rb" ); if( fp != NULL ) { setmode( fileno( fp ), O_BINARY ); count = 0L; while( fgetc( fp ) != EOF ) ++count; printf( "File contains %lu characters\n", count ); fclose( fp ); } }
WATCOM
All (except DOS/PM)