- _\bF_\bo_\bp_\be_\bn opens the file named by _\bf_\bi_\bl_\be_\bn_\ba_\bm_\be and associates a
- stream with it. _\bF_\bo_\bp_\be_\bn returns a pointer to be used to iden-
- tify the stream in subsequent operations.
-
- _\bT_\by_\bp_\be is a character string having one of the following
- values:
-
- "r" open for reading
-
- "w" create for writing
-
- "a" append: open for writing at end of file, or create for
- writing
-
- In addition, each _\bt_\by_\bp_\be may be followed by a "+" to have the
- file opened for reading and writing. "r+" positions the
- stream at the beginning of the file, "w+" creates or trun-
- cates it, and "a+" positions it at the end. Both reads and
- writes may be used on read/write streams, with the limita-
- tion that an _\bf_\bs_\be_\be_\bk, _\br_\be_\bw_\bi_\bn_\bd, or reading an end-of-file must
- be used between a read and a write or vice-versa.
-
- _\bF_\br_\be_\bo_\bp_\be_\bn substitutes the named file in place of the open
- _\bs_\bt_\br_\be_\ba_\bm. It returns the original value of _\bs_\bt_\br_\be_\ba_\bm. The ori-
- ginal stream is closed.
-
- _\bF_\br_\be_\bo_\bp_\be_\bn is typically used to attach the preopened constant
- names, s\bst\btd\bdi\bin\bn,\b, s\bst\btd\bdo\bou\but\bt,\b, s\bst\btd\bde\ber\brr\br,\b, to specified files.
-
- _\bF_\bd_\bo_\bp_\be_\bn associates a stream with a file descriptor obtained
- from _\bo_\bp_\be_\bn, _\bd_\bu_\bp, _\bc_\br_\be_\ba_\bt, or _\bp_\bi_\bp_\be(2). The _\bt_\by_\bp_\be of the stream
- must agree with the mode of the open file.
-
-S\bSE\bEE\bE A\bAL\bLS\bSO\bO
- open(2), fclose(3)
-
-
-
-Printed 7/27/90 April 1
-
-
-
-
-
-
-FOPEN(3) 1989 FOPEN(3)
-