summaryrefslogtreecommitdiff
path: root/indra/llmessage/llxfer_file.cpp
diff options
context:
space:
mode:
authorRye <rye@alchemyviewer.org>2025-12-30 11:39:16 -0500
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-01-07 02:15:43 +0200
commit25dc8660efedecfd9f021142ac1e4ff3639e80d4 (patch)
tree3751a0f21917bbe3d460ae2b613c7e5070d55dae /indra/llmessage/llxfer_file.cpp
parentb74a3c25d16685b8dfad8880e20ac99c5769d2e4 (diff)
Clean up LLFile and LLFilesystem operations to reduce temporaries allocations and utf8->utf16 conversions
Fix LLFile::tmpdir failing when temp directory is located in a unicode path on windows Add Tracy profiler tagging to LLFile that's disabled by default Replace LLFile::utf8StringToWstring with our fsyspath std::filesystem::path adapter Introduce std::filesystem::path to llifstream/llofstream wrappers Add move operators to fsyspath to match copy operator Restore LLUniqueFile RAII class for direct c file io wrapping and reducing merge conflicts with downstream code that may depend upon it Signed-off-by: Rye <rye@alchemyviewer.org>
Diffstat (limited to 'indra/llmessage/llxfer_file.cpp')
-rw-r--r--indra/llmessage/llxfer_file.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/indra/llmessage/llxfer_file.cpp b/indra/llmessage/llxfer_file.cpp
index 71b910297b..f0310c6297 100644
--- a/indra/llmessage/llxfer_file.cpp
+++ b/indra/llmessage/llxfer_file.cpp
@@ -161,7 +161,7 @@ S32 LLXfer_File::initializeRequest(U64 xfer_id,
S32 LLXfer_File::startDownload()
{
S32 retval = 0; // presume success
- mFp = LLFile::fopen(mTempFilename,"w+b"); /* Flawfinder : ignore */
+ mFp = LLFile::fopen(mTempFilename,TEXT("w+b")); /* Flawfinder : ignore */
if (mFp)
{
fclose(mFp);
@@ -209,7 +209,7 @@ S32 LLXfer_File::startSend (U64 xfer_id, const LLHost &remote_host)
mBufferStartOffset = 0;
// We leave the file open, assuming we'll start reading and sending soon
- mFp = LLFile::fopen(mLocalFilename,"rb"); /* Flawfinder : ignore */
+ mFp = LLFile::fopen(mLocalFilename,TEXT("rb")); /* Flawfinder : ignore */
if (mFp)
{
fseek(mFp,0,SEEK_END);
@@ -252,7 +252,7 @@ S32 LLXfer_File::reopenFileHandle()
if (mFp == NULL)
{
- mFp = LLFile::fopen(mLocalFilename,"rb"); /* Flawfinder : ignore */
+ mFp = LLFile::fopen(mLocalFilename,TEXT("rb")); /* Flawfinder : ignore */
if (mFp == NULL)
{
LL_INFOS("Xfer") << "Warning: " << mLocalFilename << " not found when re-opening file" << LL_ENDL;
@@ -313,7 +313,7 @@ S32 LLXfer_File::flush()
{
LL_ERRS("Xfer") << "Overwriting open file pointer!" << LL_ENDL;
}
- mFp = LLFile::fopen(mTempFilename,"a+b"); /* Flawfinder : ignore */
+ mFp = LLFile::fopen(mTempFilename,TEXT("a+b")); /* Flawfinder : ignore */
if (mFp)
{
@@ -381,11 +381,11 @@ S32 LLXfer_File::processEOF()
}
else
{
- //LLFILE* fp = LLFile::fopen(mTempFilename, "r");
+ //LLFILE* fp = LLFile::fopen(mTempFilename, TEXT("r"));
//LL_WARNS() << "File " << mTempFilename << " does "
// << (!fp ? "not" : "" ) << " exit." << LL_ENDL;
//if(fp) fclose(fp);
- //fp = LLFile::fopen(mLocalFilename, "r");
+ //fp = LLFile::fopen(mLocalFilename, TEXT("r"));
//LL_WARNS() << "File " << mLocalFilename << " does "
// << (!fp ? "not" : "" ) << " exit." << LL_ENDL;
//if(fp) fclose(fp);
@@ -452,8 +452,8 @@ U32 LLXfer_File::getXferTypeTag()
S32 copy_file(const std::string& from, const std::string& to)
{
S32 rv = 0;
- LLFILE* in = LLFile::fopen(from, "rb"); /*Flawfinder: ignore*/
- LLFILE* out = LLFile::fopen(to, "wb"); /*Flawfinder: ignore*/
+ LLFILE* in = LLFile::fopen(from, TEXT("rb")); /*Flawfinder: ignore*/
+ LLFILE* out = LLFile::fopen(to, TEXT("wb")); /*Flawfinder: ignore*/
if(in && out)
{
S32 read = 0;