Some more FS fixes.
This commit is contained in:
@@ -54,11 +54,13 @@ std::vector<FileInfo> OSFileSystemAdapter::listFiles(const fs::path& folder)
|
||||
info.isHidden = info.path.filename().string().starts_with('.'); // at least for Linux
|
||||
if (info.isFolder)
|
||||
{
|
||||
MIJIN_TRY
|
||||
std::error_code errorCode;
|
||||
fs::directory_iterator dirIt(info.path, errorCode);
|
||||
if (errorCode != std::error_code{})
|
||||
{
|
||||
info.size = std::distance(fs::directory_iterator(info.path), fs::directory_iterator());
|
||||
info.size = std::distance(dirIt, fs::directory_iterator());
|
||||
}
|
||||
MIJIN_CATCH(std::runtime_error&)
|
||||
else
|
||||
{
|
||||
info.size = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user