-----------------------------------------------------------------------------
| 928 | |
| 929 | //----------------------------------------------------------------------------- |
| 930 | S32 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 | //----------------------------------------------------------------------------- |
| 946 | bool Platform::isDirectory(const char *pDirPath) |