Sets the mode of the file.
#include <unistd.h> int setmode ( int fildes, int oflag);
(IN) Specifies a file descriptor.
(IN) Specifies the O_BINARY, the O_NDELAY flag, or a bitwise OR of these two flags. For a description of these flags, see File Control Open Modes.
If successful, returns the previous mode that was set for the file. Otherwise, returns -1 and sets errno to one of the following:
The setmode function determines whether the file is treated as a binary file or as a text file:
If the O_BINARY flag is set in the oflag parameter, data is read or written unchanged.
If the O_BINARY flag is not set in the oflag parameter, data is read or written as text.
The mode of a file should not be changed after I/O has started. The mode should be changed after calling fdopen or fopen and before calling fwrite/write, fread/read, fseek/lseek, etc.