diff --git a/stim/util/filesize.h b/stim/util/filesize.h index 273fe8b..c053f71 100644 --- a/stim/util/filesize.h +++ b/stim/util/filesize.h @@ -3,6 +3,9 @@ #ifdef _WIN32 #include +#else +#include +#include #endif namespace stim{ @@ -17,10 +20,10 @@ static size_t file_size(std::string filename){ } CloseHandle(hFile); return (size_t)size.QuadPart; -#elif - - - +#else + struct stat sb; + stat(filename.c_str(), &sb); + return sb.st_size; #endif } @@ -28,4 +31,4 @@ static size_t file_size(std::string filename){ -#endif \ No newline at end of file +#endif -- libgit2 0.21.4