Skip to content

Commit

Permalink
IO: changed FileMode::SysRead to use the virtual fs paths as fallback…
Browse files Browse the repository at this point in the history
…, too

this fixes an issue where the downloaded files from the asset panel couldn't
get opened because the file system archive instance is expecting a full path
at that point
  • Loading branch information
mgerhardy committed Jun 18, 2024
1 parent 3180195 commit 4dac446
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/io/File.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ enum class FileMode {
Read, /**< reading from the virtual file system */
Write, /**< writing into the virtual file system */
Append, /**< appending to an existing file or create a new one */
SysRead, /**< reading from the given path */
SysRead, /**< reading from the given path - using virtual paths as fallback */
SysWrite, /**< writing into the given path */
ReadNoHome /**< reading from the virtual file system but skip user setting files in the home directories */
};
Expand Down
2 changes: 1 addition & 1 deletion src/modules/io/Filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ io::FilePtr Filesystem::open(const core::String &filename, FileMode mode) const
if (mode == FileMode::SysWrite) {
Log::debug("Use absolute path to open file %s for writing", filename.c_str());
return core::make_shared<io::File>(filename, mode);
} else if (mode == FileMode::SysRead) {
} else if (mode == FileMode::SysRead && fs_exists(filename.c_str())) {
return core::make_shared<io::File>(filename, mode);
} else if (mode == FileMode::Write) {
if (!isRelativePath(filename)) {
Expand Down

0 comments on commit 4dac446

Please sign in to comment.