Correct OpenFile filemode check (#2390)

This commit is contained in:
Benoist
2026-01-21 15:58:24 +01:00
committed by GitHub
parent 22d740ef61
commit 8907569dd8
2 changed files with 29 additions and 23 deletions
+2 -1
View File
@@ -305,6 +305,7 @@ native bool ReadDirEntry(Handle dir, char[] buffer, int maxlength, FileType &typ
* "r": Open an existing file for reading.
* "w": Create a file for writing, or truncate (delete the contents of) an
* existing file and then open it for writing.
* "wx": Create file for writing, fails if file already exists.
* "a": Create a file for writing, or open an existing file such that writes
* will be appended to the end.
* "r+": Open an existing file for both reading and writing.
@@ -314,7 +315,7 @@ native bool ReadDirEntry(Handle dir, char[] buffer, int maxlength, FileType &typ
* such that writes will be appended to the end.
*
* The open mode may also contain an additional character after "r", "w", or "a",
* but before any "+" sign. This character may be "b" (indicating binary mode) or
* but before the "+" sign. This character may be "b" (indicating binary mode) or
* "t" (indicating text mode). By default, "text" mode is implied. On Linux and
* Mac, this has no distinction from binary mode. On Windows, it causes the '\n'
* character (0xA) to be written as "\r\n" (0xD, 0xA).