mirror of
https://github.com/SatDump/SatDump
synced 2026-08-13 17:47:30 -04:00
14 lines
323 B
C++
14 lines
323 B
C++
|
|
#include "file.h"
|
||
|
|
#include <fstream>
|
||
|
|
|
||
|
|
namespace satdump
|
||
|
|
{
|
||
|
|
// Return filesize
|
||
|
|
uint64_t getFilesize(std::string filepath)
|
||
|
|
{
|
||
|
|
std::ifstream file(filepath, std::ios::binary | std::ios::ate);
|
||
|
|
uint64_t fileSize = file.tellg();
|
||
|
|
file.close();
|
||
|
|
return fileSize;
|
||
|
|
}
|
||
|
|
} // namespace satdump
|