* Change Athena::utility::fileSize to use stat64 instead of ftello

* Fix output of ftello64 in win32_largefilewrapper
This commit is contained in:
2014-12-28 14:38:55 -08:00
parent be135d1caa
commit f322f1d7e7
6 changed files with 10 additions and 11 deletions

View File

@@ -22,6 +22,7 @@
#include <cstdarg>
#include <iterator>
#include <cstdio>
#include <sys/stat.h>
namespace Athena
{
@@ -365,13 +366,11 @@ int countChar(const std::string& str, const char chr, int* lastOccur)
return ret;
}
atUint64 fileSize(FILE* f)
atUint64 fileSize(const std::string& filename)
{
atUint64 oldPos = ftello64(f);
fseeko64(f, 0, SEEK_END);
atUint64 size = ftello64(f);
fseeko64(f, oldPos, SEEK_SET);
return size;
struct stat64 st;
stat64(filename.c_str(), &st);
return st.st_size;
}
std::string& ltrim(std::string& s)