MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / getFileSize

Method getFileSize

engine/source/platformEmscripten/EmscriptenFileio.cpp:930–943  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

928
929//-----------------------------------------------------------------------------
930S32 Platform::getFileSize(const char *pFilePath)
931{
932 if (!pFilePath || !*pFilePath)
933 return -1;
934 // Get the file info
935 struct stat fStat;
936 if (stat(pFilePath, &fStat) < 0)
937 return -1;
938 // if the file is a "regular file" then return the size
939 if ( (fStat.st_mode & S_IFMT) == S_IFREG)
940 return fStat.st_size;
941 // Must be something else or we can't read the file.
942 return -1;
943}
944
945//-----------------------------------------------------------------------------
946bool Platform::isDirectory(const char *pDirPath)

Callers

nothing calls this directly

Calls 1

statClass · 0.70

Tested by

no test coverage detected