diff options
Diffstat (limited to 'src/common/fs/file.cpp')
| -rw-r--r-- | src/common/fs/file.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/fs/file.cpp b/src/common/fs/file.cpp index 710e88b39..077f34995 100644 --- a/src/common/fs/file.cpp +++ b/src/common/fs/file.cpp | |||
| @@ -172,7 +172,7 @@ std::string ReadStringFromFile(const std::filesystem::path& path, FileType type) | |||
| 172 | 172 | ||
| 173 | size_t WriteStringToFile(const std::filesystem::path& path, FileType type, | 173 | size_t WriteStringToFile(const std::filesystem::path& path, FileType type, |
| 174 | std::string_view string) { | 174 | std::string_view string) { |
| 175 | if (!IsFile(path)) { | 175 | if (Exists(path) && !IsFile(path)) { |
| 176 | return 0; | 176 | return 0; |
| 177 | } | 177 | } |
| 178 | 178 | ||
| @@ -183,7 +183,7 @@ size_t WriteStringToFile(const std::filesystem::path& path, FileType type, | |||
| 183 | 183 | ||
| 184 | size_t AppendStringToFile(const std::filesystem::path& path, FileType type, | 184 | size_t AppendStringToFile(const std::filesystem::path& path, FileType type, |
| 185 | std::string_view string) { | 185 | std::string_view string) { |
| 186 | if (!IsFile(path)) { | 186 | if (Exists(path) && !IsFile(path)) { |
| 187 | return 0; | 187 | return 0; |
| 188 | } | 188 | } |
| 189 | 189 | ||