summaryrefslogtreecommitdiff
path: root/src/common/fs/fs.h
diff options
context:
space:
mode:
authorGravatar Morph2021-06-19 03:49:11 -0400
committerGravatar Morph2021-06-22 15:06:58 -0400
commit76b2313b25e2fd33a508f63137d5113e1ca85150 (patch)
treeda79f542733f16ca27b834da5805a75503b1019a /src/common/fs/fs.h
parentcommon: fs: file: Remove [[nodiscard]] attribute from Flush (diff)
downloadyuzu-76b2313b25e2fd33a508f63137d5113e1ca85150.tar.gz
yuzu-76b2313b25e2fd33a508f63137d5113e1ca85150.tar.xz
yuzu-76b2313b25e2fd33a508f63137d5113e1ca85150.zip
common: fs: Amend IsFile check in FileOpen / (Write/Append)StringToFile
This check was preventing files with the Write or Append file access modes from being created, as per the documented behavior in FileAccessMode. This amends the check to test for the existence of a filesystem object prior to checking whether it is a regular file. Thanks to liushuyu for pointing out that removing the check altogether would not guard against attempting to open non-regular files such as directories, symlinks, FIFO (pipes), sockets, block devices, or character devices. The documentation has also been updated for these functions to clarify that a file refers to a regular file.
Diffstat (limited to 'src/common/fs/fs.h')
-rw-r--r--src/common/fs/fs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/fs/fs.h b/src/common/fs/fs.h
index cf7dfffcc..a6c993962 100644
--- a/src/common/fs/fs.h
+++ b/src/common/fs/fs.h
@@ -110,8 +110,8 @@ template <typename Path1, typename Path2>
110 * 110 *
111 * Failures occur when: 111 * Failures occur when:
112 * - Input path is not valid 112 * - Input path is not valid
113 * - Filesystem object at path is not a file 113 * - Filesystem object at path exists and is not a regular file
114 * - The file is not opened 114 * - The file is not open
115 * 115 *
116 * @param path Filesystem path 116 * @param path Filesystem path
117 * @param mode File access mode 117 * @param mode File access mode