home *** CD-ROM | disk | FTP | other *** search
- @node setmode, io
- @subheading Syntax
-
- @example
- #include <io.h>
-
- int setmode(int file, int mode);
- @end example
-
- @subheading Description
-
-
- This function sets the mode of the given @var{file} to @var{mode}, which
- is either @code{O_TEXT} or @code{O_BINARY}. It will also set the file
- into either cooked or raw mode accordingly, and set any @code{FILE*}
- objects that use this file into text or binary mode.
-
- Note that, for buffered streams (@code{FILE*}), you must call
- @code{fflush} (@pxref{fflush}) before @code{setmode}, or call
- @code{setmode} before writing anything to the file, for proper
- operation.
-
- @subheading Return Value
-
- When successful, the function will return the previous mode of the
- given @var{file}. In case of failure, -1 is returned and @var{errno}
- is set.
-
- @subheading Example
-
- @example
- setmode(0, O_BINARY);
- @end example
-
-