MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getFileSize

Method getFileSize

Engine/source/platformPOSIX/POSIXFileio.cpp:1011–1024  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1009
1010//-----------------------------------------------------------------------------
1011S32 Platform::getFileSize(const char *pFilePath)
1012{
1013 if (!pFilePath || !*pFilePath)
1014 return -1;
1015 // Get the file info
1016 struct stat fStat;
1017 if (stat(pFilePath, &fStat) < 0)
1018 return -1;
1019 // if the file is a "regular file" then return the size
1020 if ( (fStat.st_mode & S_IFMT) == S_IFREG)
1021 return fStat.st_size;
1022 // Must be something else or we can't read the file.
1023 return -1;
1024}
1025
1026//-----------------------------------------------------------------------------
1027bool Platform::isDirectory(const char *pDirPath)

Callers

nothing calls this directly

Calls 1

statClass · 0.70

Tested by

no test coverage detected