| 248 | } |
| 249 | |
| 250 | uint64 AndroidFileSystem::GetFileSize(const StringView& path) |
| 251 | { |
| 252 | struct stat fileInfo; |
| 253 | fileInfo.st_size = 0; |
| 254 | const StringAsANSI<> pathANSI(*path, path.Length()); |
| 255 | if (stat(pathANSI.Get(), &fileInfo) != -1) |
| 256 | { |
| 257 | if (S_ISDIR(fileInfo.st_mode)) |
| 258 | { |
| 259 | fileInfo.st_size = 0; |
| 260 | } |
| 261 | } |
| 262 | else |
| 263 | { |
| 264 | AAsset* asset = AAssetManager_open(GetAssetManager(), pathANSI.Get(), AASSET_MODE_UNKNOWN); |
| 265 | if (asset) |
| 266 | { |
| 267 | fileInfo.st_size = AAsset_getLength64(asset); |
| 268 | AAsset_close(asset); |
| 269 | } |
| 270 | } |
| 271 | return fileInfo.st_size; |
| 272 | } |
| 273 | |
| 274 | bool AndroidFileSystem::IsReadOnly(const StringView& path) |
| 275 | { |