summaryrefslogtreecommitdiff
path: root/indra/llfilesystem/lldir.cpp
diff options
context:
space:
mode:
authorCallum Prentice <callum@gmail.com>2025-09-05 13:44:57 -0700
committerCallum Prentice <callum@gmail.com>2025-09-05 13:44:57 -0700
commit94cfce4a4d2dbc799e5e8a3495a628ae85d4cffe (patch)
tree940f3139d5ba57fc2bb7a1b6d52502eeaf50c8ed /indra/llfilesystem/lldir.cpp
parent12704b941132ec6fb6ca62da007c3ec02292c872 (diff)
Revert "Replace boost filesystem with std filesystem"
This reverts commit 94e45ca2e60b4013a4e38d8f2c1fe8dad4207c3a.
Diffstat (limited to 'indra/llfilesystem/lldir.cpp')
-rw-r--r--indra/llfilesystem/lldir.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp
index 06f5dd2f77..ea33a3bb90 100644
--- a/indra/llfilesystem/lldir.cpp
+++ b/indra/llfilesystem/lldir.cpp
@@ -43,7 +43,7 @@
#include "lldiriterator.h"
#include "stringize.h"
#include "llstring.h"
-#include <filesystem>
+#include <boost/filesystem.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/assign/list_of.hpp>
@@ -103,24 +103,24 @@ std::vector<std::string> LLDir::getFilesInDir(const std::string &dirname)
//Returns a vector of fullpath filenames.
#ifdef LL_WINDOWS // or BOOST_WINDOWS_API
- std::filesystem::path p(ll_convert<std::wstring>(dirname));
+ boost::filesystem::path p(ll_convert<std::wstring>(dirname));
#else
- std::filesystem::path p(dirname);
+ boost::filesystem::path p(dirname);
#endif
std::vector<std::string> v;
- std::error_code ec;
- if (std::filesystem::exists(p, ec) && ec.value() == 0)
+ boost::system::error_code ec;
+ if (exists(p, ec) && !ec.failed())
{
- if (is_directory(p, ec) && ec.value() == 0)
+ if (is_directory(p, ec) && !ec.failed())
{
- std::filesystem::directory_iterator end_iter;
- for (std::filesystem::directory_iterator dir_itr(p);
+ boost::filesystem::directory_iterator end_iter;
+ for (boost::filesystem::directory_iterator dir_itr(p);
dir_itr != end_iter;
++dir_itr)
{
- if (std::filesystem::is_regular_file(dir_itr->status()))
+ if (boost::filesystem::is_regular_file(dir_itr->status()))
{
v.push_back(dir_itr->path().filename().string());
}
@@ -197,24 +197,24 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name)
try
{
#ifdef LL_WINDOWS // or BOOST_WINDOWS_API
- std::filesystem::path dir_path(ll_convert<std::wstring>(dir_name));
+ boost::filesystem::path dir_path(ll_convert<std::wstring>(dir_name));
#else
- std::filesystem::path dir_path(dir_name);
+ boost::filesystem::path dir_path(dir_name);
#endif
- if (std::filesystem::exists(dir_path))
+ if (boost::filesystem::exists(dir_path))
{
- if (!std::filesystem::is_empty(dir_path))
+ if (!boost::filesystem::is_empty(dir_path))
{ // Directory has content
- num_deleted = (U32)std::filesystem::remove_all(dir_path);
+ num_deleted = (U32)boost::filesystem::remove_all(dir_path);
}
else
{ // Directory is empty
- std::filesystem::remove(dir_path);
+ boost::filesystem::remove(dir_path);
}
}
}
- catch (std::filesystem::filesystem_error &er)
+ catch (boost::filesystem::filesystem_error &er)
{
LL_WARNS() << "Failed to delete " << dir_name << " with error " << er.code().message() << LL_ENDL;
}