Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ setmode(DOS) — Xenix 2.3.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

creat(S)

fopen(S)

open(S)

SETMODE(DOS)



     SETMODE(DOS)             XENIX System V              SETMODE(DOS)



     Name
          setmode - Sets translation mode.

     Syntax
          #include <fcntl.h>
          #include <io.h>

          int setmode (handle, mode);
          int handle;
          int mode;

     Description
          The setmode function sets the translation mode of the file
          given by handle to mode.  The mode must be one of the
          following manifest constants:

            Manifest Constant   Meaning

            O_TEXT              Set text (translated) mode.
                                Carriage return/linefeed
                                combinations (CR-LF) are
                                translated into a single
                                linefeed (LF) on input.
                                Linefeed characters are
                                translated into carriage
                                return/linefeed combinations on
                                output.

            O_BINARY            Set binary (untranslated) mode.
                                The above translations are
                                suppressed.

          setmode is typically used to modify the default translation
          mode of stdin, stdout, stderr, stdaux, and stdprn, but can
          be used on any file.

     Return Value
          If successful, setmode returns the previous translation
          mode.  A return value of -1 indicates an error, and errno is
          set to one of the following values:

            Value    Meaning

            EBADF    Invalid file handle

            EINVAL   Invalid mode argument (neither
                     O_TEXT nor O_BINARY)


     See Also
          creat(S), fopen(S), open(S)




     Page 1                                           (printed 8/7/87)





     SETMODE(DOS)             XENIX System V              SETMODE(DOS)



     Example
          #include <stdio.h> #include <fcntl.h> #include <io.h>

          int result;

          /* The following statement sets stdin to be binary **
          (initially it is text).  */

          result = setmode (fileno (stdin),OBINARY);

     Notes
          This call must be compiled with the -dos flag.











































     Page 2                                           (printed 8/7/87)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026