MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / GetFileSize

Function GetFileSize

Source/Internal/filesystem.cpp:1256–1271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1254}
1255
1256uint64_t GetFileSize(const Path& file) {
1257 if (file.isValid()) {
1258 FILE* f = my_fopen(file.GetFullPath(), "rb");
1259 if (f) {
1260 fseek(f, 0L, SEEK_END);
1261 long size_b = ftell(f);
1262 fclose(f);
1263
1264 return (uint64_t)size_b;
1265 } else {
1266 return 0;
1267 }
1268 } else {
1269 return 0;
1270 }
1271}
1272
1273void CreateBackup(const char* path, int max_backup_count /*= 10*/) {
1274 pair<string, string> path_file_name = SplitPathFileName(path);

Callers 4

ReadEntireFileMethod · 0.85
GetUploadValidityMethod · 0.85
File_GetLengthFunction · 0.85
GetFileSizeExFunction · 0.85

Calls 3

my_fopenFunction · 0.85
GetFullPathMethod · 0.80
isValidMethod · 0.45

Tested by 1

ReadEntireFileMethod · 0.68