diff options
Diffstat (limited to 'src/zencore/filesystem.cpp')
| -rw-r--r-- | src/zencore/filesystem.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp index e9f7ba72c..b64c9973e 100644 --- a/src/zencore/filesystem.cpp +++ b/src/zencore/filesystem.cpp @@ -982,6 +982,11 @@ FileSystemTraversal::TraverseFileSystem(const std::filesystem::path& RootDir, Tr if (FAILED(hRes)) { + if (hRes == ERROR_FILE_NOT_FOUND) + { + // Directory no longer exist, treat it as empty + return; + } ThrowSystemException(hRes, fmt::format("Failed to open handle to '{}'", RootDir)); } @@ -1057,6 +1062,12 @@ FileSystemTraversal::TraverseFileSystem(const std::filesystem::path& RootDir, Tr DIR* Dir = opendir(RootDir.c_str()); if (Dir == nullptr) { + int Err = errno; + if (Err == ENOENT) + { + // Directory no longer exist, treat it as empty + return; + } ThrowLastError(fmt::format("Failed to open directory for traversal: {}", RootDir.c_str())); } |