From 974c09f6f37845d5b08e56638a4705eb32ca7b03 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Fri, 5 Mar 2021 00:28:04 -0500 Subject: [PATCH] I hate file io platform bullshit --- indra/llfilesystem/llfilesystem.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/indra/llfilesystem/llfilesystem.cpp b/indra/llfilesystem/llfilesystem.cpp index 77fd54a3736..8be59e7a115 100644 --- a/indra/llfilesystem/llfilesystem.cpp +++ b/indra/llfilesystem/llfilesystem.cpp @@ -205,10 +205,11 @@ S32 LLFileSystem::tell() const S32 LLFileSystem::getSize() { S32 file_size = 0; - llstat stat; - if (LLFile::stat(mFilePath, &stat) == 0) + LLUniqueFile filep = LLFile::fopen(mFilePath, TEXT("rb")); + if (filep) { - file_size = stat.st_size; + fseek(filep, 0L, SEEK_END); + file_size = ftell(filep); } return file_size; -- GitLab