| 186 | } |
| 187 | |
| 188 | UInt32 FileSystem::GetSize(Exception& ex,const char* path, size_t size, UInt32 defaultValue) { |
| 189 | Status status; |
| 190 | if (Stat(path, size, status)<=0) { |
| 191 | ex.set(Exception::FILE, path, " doesn't exist"); |
| 192 | return defaultValue; |
| 193 | } |
| 194 | if (status.st_mode&S_IFDIR) { // if was a folder |
| 195 | ex.set(Exception::FILE, "GetSize works just on file, and ", path, " is a folder"); |
| 196 | return defaultValue; |
| 197 | } |
| 198 | return (UInt32)status.st_size; |
| 199 | } |
| 200 | |
| 201 | bool FileSystem::Exists(const char* path, size_t size) { |
| 202 | Status status; |