Skip to content

Commit ff9ab19

Browse files
TylerMSFTTylerMSFT
authored andcommitted
updates
1 parent d2ec248 commit ff9ab19

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

docs/c-runtime-library/reference/fopen-s-wfopen-s.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ errno_t _wfopen_s(
3434
A pointer to the file pointer that receives the pointer to the opened file.
3535

3636
*`filename`*\
37-
The file to open.
37+
The name of the file to open.
3838

3939
*`mode`*\
4040
Type of access permitted.
@@ -115,7 +115,7 @@ In addition to the previous values, the following characters can be included in
115115

116116
| *`mode`* modifier | Translation mode |
117117
|--|--|
118-
| **`t`** | Open in text (translated) mode. In this mode, carriage return-line feed (CR-LF) combinations are translated into single line feeds (LF) on input and LF characters are translated to CR-LF combinations on output. Also, CTRL+Z is interpreted as an end-of-file character on input. |
118+
| **`t`** | Open in text (translated) mode. Carriage return-line feed (CR-LF) combinations are translated into single line feeds (LF) on input and LF characters are translated to CR-LF combinations on output. CTRL+Z is interpreted as an end-of-file character on input. |
119119
| **`b`** | Open in binary (untranslated) mode; translations involving carriage-return and line feed characters are suppressed. |
120120

121121
In text (translated) mode, `CTRL`+**Z** is interpreted as an end-of-file character on input. For files opened for reading/writing with **`"a+"`**, **`fopen_s`** checks for a `CTRL`+**Z** at the end of the file and removes it, if possible. It's removed because using [`fseek`](fseek-fseeki64.md) and [`ftell`](ftell-ftelli64.md) to move within a file that ends with a `CTRL`+**Z**, may cause **`fseek`** to behave improperly near the end of the file.

docs/c-runtime-library/reference/fopen-wfopen.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ In addition to the earlier values, the following characters can be appended to *
106106

107107
| *`mode`* modifier | Translation mode |
108108
|--|--|
109-
| **`t`** | Open in text (translated) mode. In this mode, carriage return-line feed (CR-LF) combinations are translated into single line feeds (LF) on input and LF characters are translated to CR-LF combinations on output. Also, CTRL+Z is interpreted as an end-of-file character on input. |
109+
| **`t`** | Open in text (translated) mode. Carriage return-line feed (CR-LF) combinations are translated into single line feeds (LF) on input and LF characters are translated to CR-LF combinations on output. Also, CTRL+Z is interpreted as an end-of-file character on input. |
110110
| **`b`** | Open in binary (untranslated) mode; translations involving carriage-return and line feed characters are suppressed. |
111111

112112
In text mode, `CTRL`+**Z** is interpreted as an EOF character on input. In files that are opened for reading/writing by using **`"a+"`**, **`fopen`** checks for a `CTRL`+**Z** at the end of the file and removes it, if it's possible. It's removed because using [`fseek`](fseek-fseeki64.md) and **`ftell`** to move within a file that ends with `CTRL`+**Z** may cause [`fseek`](fseek-fseeki64.md) to behave incorrectly near the end of the file.
@@ -128,7 +128,7 @@ The following options can be appended to *`mode`* to specify more behaviors.
128128
| **`S`** | Specifies that caching is optimized for, but not restricted to, sequential access from disk. |
129129
| **`R`** | Specifies that caching is optimized for, but not restricted to, random access from disk. |
130130
| **`T`** | Specifies a file that isn't written to disk unless memory pressure requires it. |
131-
| **`D`** | Specifies a temporary file that is deleted when the last file pointer to it is closed. |
131+
| **`D`** | Specifies a temporary file that's deleted when the last file pointer to it is closed. |
132132
| **`ccs=encoding`** | Specifies the encoded character set to use (one of **`UTF-8`**, **`UTF-16LE`**, or `UNICODE`) for this file. Leave unspecified if you want ANSI encoding. This flag is separated from flags that precede it by a comma (`,`). For example: `FILE *f = fopen("newfile.txt", "rt+, ccs=UTF-8");` |
133133

134134
Valid characters for the *`mode`* string that is used in **`fopen`** and **`_fdopen`** correspond to *`oflag`* arguments that are used in [`_open`](open-wopen.md) and [`_sopen`](sopen-wsopen.md), as follows.

docs/c-runtime-library/reference/fsopen-wfsopen.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ When a file is opened with the **"`a`"** or **"`a+`"** access type, all write op
6868
|---|---|
6969
| **`t`** | Opens a file in text (translated) mode. In this mode, carriage return-line feed (CR-LF) combinations are translated into single line feeds (LF) on input and LF characters are translated to CR-LF combinations on output. Also, CTRL+Z is interpreted as an end-of-file character on input. In files opened for reading or reading/writing, **`_fsopen`** checks for a CTRL+Z at the end of the file and removes it, if possible. It's removed because using [`fseek`](fseek-fseeki64.md) and [`ftell`](ftell-ftelli64.md) to move within a file that ends with a CTRL+Z might cause [`fseek`](fseek-fseeki64.md) to behave improperly near the end of the file. |
7070
| **`b`** | Opens a file in binary (untranslated) mode; the above translations are suppressed. |
71-
| **`D`** | Specifies a temporary file that is deleted when the last file pointer to it is closed. |
71+
| **`D`** | Specifies a temporary file that's deleted when the last file pointer to it is closed. |
7272
| **`R`** | Specifies that caching is optimized for, but not restricted to, random access from disk. |
7373
| **`S`** | Specifies that caching is optimized for, but not restricted to, sequential access from disk. |
7474
| **`T`** | Specifies a file that isn't written to disk unless memory pressure requires it. |
@@ -80,6 +80,8 @@ Regarding `T` and `D`:
8080
- `D` specifies a regular file that is written to disk. The difference is that it's automatically deleted when it's closed.
8181
You can combine `TD` to get both semantics.
8282

83+
`_fsopen` and `_wfsopen` are Microsoft-specific variants of [`fopen`](fopen-wfopen.md). They aren't part of the ANSI standard. For a more portable and secure function, if you don't require file sharing, consider [`_wfopen_s` or `fopen_s`](fopen-s-wfopen-s.md).
84+
8385
The argument *`shflag`* is a constant expression consisting of one of the following manifest constants, defined in `Share.h`.
8486

8587
| Term | Definition |
@@ -89,7 +91,6 @@ The argument *`shflag`* is a constant expression consisting of one of the follow
8991
| `_SH_DENYRW` | Denies read and write access to the file. |
9092
| `_SH_DENYWR` | Denies write access to the file. |
9193

92-
`_fsopen` and `_wfsopen` are Microsoft-specific variants of [`fopen`](fopen-wfopen.md). They aren't part of the ANSI standard. For a more portable function, consider [`_wfopen_s` or `fopen_s`](fopen-s-wfopen-s.md).
9394

9495
By default, this function's global state is scoped to the application. To change this behavior, see [Global state in the CRT](../global-state.md).
9596

0 commit comments

Comments
 (0)