setmode

set the translation mode (not useful under QNX)

Synopsis:

#include <unistd.h>
#include <fcntl.h>
int setmode( int filedes , int mode );

Description:

The setmode() is provided for compatibility with other systems. setmode() performs no useful action under QNX .

Returns:

setmode() always returns O_BINARY under QNX . This manifest is defined in the fcntl.h header file.

See also:

chsize(), close(), creat(), dup(), dup2(), eof(), exec... functions, fcntl(), filelength(), fileno(), fstat(), isatty(), lseek(), open(), read(), sopen(), stat(), tell(), umask(), write()

Examples:

#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 );
    }
  }

Classification:

WATCOM

Systems:

All (except DOS/PM)