--- a/diskfile.cpp +++ b/diskfile.cpp @@ -340,7 +340,18 @@ list* DiskFile::FindFiles(string path, string wildcard) return matches; } - +u64 DiskFile::GetFileSize(string filename) +{ + struct _stati64 st; + if ((0 == _stati64(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG))) + { + return st.st_size; + } + else + { + return 0; + } +} ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -689,6 +700,18 @@ list* DiskFile::FindFiles(string path, string wildcard) return matches; } +u64 DiskFile::GetFileSize(string filename) +{ + struct stat st; + if ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG))) + { + return st.st_size; + } + else + { + return 0; + } +} ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// #endif @@ -802,18 +825,6 @@ bool DiskFile::FileExists(string filename) return ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG))); } -u64 DiskFile::GetFileSize(string filename) -{ - struct stat st; - if ((0 == stat(filename.c_str(), &st)) && (0 != (st.st_mode & S_IFREG))) - { - return st.st_size; - } - else - { - return 0; - } -}