Replace is_directory checking method

pull/788/head
Levin Li 2020-06-23 18:11:54 +08:00
parent 0754b85ee1
commit 56ac73be36
3 changed files with 6 additions and 3 deletions

View File

@ -261,7 +261,8 @@ void VirtualTexture::populateTileTree()
for (int i = 0; i < MaxResolutionLevels; i++)
{
fs::path path = tilePath / fmt::sprintf("level%d", i);
if (fs::is_directory(path))
std::error_code ec;
if (fs::is_directory(path, ec))
{
maxLevel = i + baseSplit;
int uLimit = 2 << maxLevel;

View File

@ -100,7 +100,8 @@ static bool is_valid_directory(const fs::path& dir)
if (dir.empty())
return false;
if (!is_directory(dir))
std::error_code ec;
if (!fs::is_directory(dir, ec))
{
fmt::fprintf(cerr, "Path %s doesn't exist or isn't a directory", dir);
return false;

View File

@ -165,7 +165,8 @@ static string lua_path(const CelestiaConfig *config)
if (dir.empty())
continue;
if (!is_directory(dir))
std::error_code ec;
if (!fs::is_directory(dir, ec))
{
fmt::fprintf(cerr, "Path %s doesn't exist or isn't a directory", dir);
continue;