summaryrefslogtreecommitdiff
path: root/indra/llfilesystem
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2026-02-24 17:37:15 -0600
committerGitHub <noreply@github.com>2026-02-24 17:37:15 -0600
commitb601bfdd6220da86b9c757180abc5ba618d9759c (patch)
tree483e3be2650b03e85fb621697b5b313ee7324785 /indra/llfilesystem
parent37dd2c70380165b51a685b7b24829f4d3e15ddd8 (diff)
parent6cd2a02c7fbacfd4cf2cf9055e1c282bac3afeb6 (diff)
Merge pull request #5452 from secondlife/develop
Develop -> 2026.02
Diffstat (limited to 'indra/llfilesystem')
-rw-r--r--indra/llfilesystem/llfilesystem.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/indra/llfilesystem/llfilesystem.cpp b/indra/llfilesystem/llfilesystem.cpp
index 541266af4f..728ff396ef 100644
--- a/indra/llfilesystem/llfilesystem.cpp
+++ b/indra/llfilesystem/llfilesystem.cpp
@@ -77,11 +77,10 @@ bool LLFileSystem::getExists(const LLUUID& file_id, const LLAssetType::EType fil
LL_PROFILE_ZONE_SCOPED;
const std::string filename = LLDiskCache::metaDataToFilepath(file_id, file_type);
- llifstream file(filename, std::ios::binary);
- if (file.is_open())
+ boost::system::error_code ec;
+ if (boost::filesystem::exists(filename, ec) && boost::filesystem::is_regular_file(filename, ec))
{
- file.seekg(0, std::ios::end);
- return file.tellg() > 0;
+ return boost::filesystem::file_size(filename, ec) > 0;
}
return false;
}
@@ -120,15 +119,12 @@ S32 LLFileSystem::getFileSize(const LLUUID& file_id, const LLAssetType::EType fi
{
const std::string filename = LLDiskCache::metaDataToFilepath(file_id, file_type);
- S32 file_size = 0;
- llifstream file(filename, std::ios::binary);
- if (file.is_open())
+ boost::system::error_code ec;
+ if (boost::filesystem::exists(filename, ec) && boost::filesystem::is_regular_file(filename, ec))
{
- file.seekg(0, std::ios::end);
- file_size = (S32)file.tellg();
+ return static_cast<S32>(boost::filesystem::file_size(filename, ec));
}
-
- return file_size;
+ return 0;
}
bool LLFileSystem::read(U8* buffer, S32 bytes)