Clarify behavior of opening a new file in `FileAccess`

The containing directory must exist for this to succeed.

(cherry picked from commit a775d8bf5a)
This commit is contained in:
A Thousand Ships 2024-02-24 12:09:34 +01:00 committed by Rémi Verschelde
parent f518099f73
commit e96c67d725
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 0 deletions

View File

@ -463,12 +463,14 @@
</constant>
<constant name="WRITE" value="2" enum="ModeFlags">
Opens the file for write operations. The file is created if it does not exist, and truncated if it does.
[b]Note:[/b] When creating a file it must be in an already existing directory. To recursively create directories for a file path, see [method DirAccess.make_dir_recursive]).
</constant>
<constant name="READ_WRITE" value="3" enum="ModeFlags">
Opens the file for read and write operations. Does not truncate the file. The cursor is positioned at the beginning of the file.
</constant>
<constant name="WRITE_READ" value="7" enum="ModeFlags">
Opens the file for read and write operations. The file is created if it does not exist, and truncated if it does. The cursor is positioned at the beginning of the file.
[b]Note:[/b] When creating a file it must be in an already existing directory. To recursively create directories for a file path, see [method DirAccess.make_dir_recursive]).
</constant>
<constant name="COMPRESSION_FASTLZ" value="0" enum="CompressionMode">
Uses the [url=https://fastlz.org/]FastLZ[/url] compression method.