summaryrefslogtreecommitdiff
path: root/indra/llfilesystem/lldiriterator.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2026-10-13 14:30:21 -0400
committerGitHub <noreply@github.com>2026-10-13 14:30:21 -0400
commit8ba5d1a8adc47c21b23d9482e72de9517f9a98fc (patch)
treef97d67c8ee574c6ebaac8d0d8ba120d041dca051 /indra/llfilesystem/lldiriterator.cpp
parent18648fc51e2a0c750182d8aa3814ed5b6bf8445e (diff)
parentefc7d2d7bb542ac905cb7ebd82ee329523f95608 (diff)
Merge pull request #6193 from secondlife/release/26.4
Release/26.4
Diffstat (limited to 'indra/llfilesystem/lldiriterator.cpp')
-rw-r--r--indra/llfilesystem/lldiriterator.cpp36
1 files changed, 20 insertions, 16 deletions
diff --git a/indra/llfilesystem/lldiriterator.cpp b/indra/llfilesystem/lldiriterator.cpp
index e8c37389d2..ec6d1726f0 100644
--- a/indra/llfilesystem/lldiriterator.cpp
+++ b/indra/llfilesystem/lldiriterator.cpp
@@ -24,13 +24,14 @@
* $/LicenseInfo$
*/
+#include "linden_common.h"
+
#include "lldiriterator.h"
-#include "fix_macros.h"
#include "llregex.h"
-#include <boost/filesystem.hpp>
+#include <filesystem>
-namespace fs = boost::filesystem;
+namespace fs = std::filesystem;
static std::string glob_to_regex(const std::string& glob);
@@ -51,11 +52,7 @@ private:
LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask)
: mIsValid(false)
{
-#ifdef LL_WINDOWS // or BOOST_WINDOWS_API
- fs::path dir_path(ll_convert<std::wstring>(dirname));
-#else
- fs::path dir_path(dirname);
-#endif
+ fs::path dir_path = fsyspath(dirname);
bool is_dir = false;
@@ -72,7 +69,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask)
if (!is_dir)
{
- LL_WARNS() << "Invalid path: \"" << dir_path.string() << "\"" << LL_ENDL;
+ LL_WARNS() << "Invalid path: \"" << dirname << "\"" << LL_ENDL;
return;
}
@@ -129,20 +126,27 @@ bool LLDirIterator::Impl::next(std::string &fname)
{
while (mIter != end_itr && !found)
{
- boost::smatch match;
- std::string name = mIter->path().filename().string();
- found = ll_regex_match(name, match, mFilterExp);
- if (found)
+ try
{
- fname = name;
+ boost::smatch match;
+ std::string name = fsyspath(mIter->path().filename()).string();
+ found = ll_regex_match(name, match, mFilterExp);
+ if (found)
+ {
+ fname = name;
+ }
+ }
+ catch (const std::system_error& e)
+ {
+ LL_WARNS() << "Exception accessing directory entry: " << e.what() << LL_ENDL;
}
++mIter;
}
}
- catch (const fs::filesystem_error& e)
+ catch (const std::system_error& e)
{
- LL_WARNS() << e.what() << LL_ENDL;
+ LL_WARNS() << "Exception iterating directory: " << e.what() << LL_ENDL;
}
return found;