MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / GetFileSize

Method GetFileSize

Source/Engine/Platform/Android/AndroidFileSystem.cpp:250–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250uint64 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
274bool AndroidFileSystem::IsReadOnly(const StringView& path)
275{

Callers

nothing calls this directly

Calls 3

statClass · 0.70
LengthMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected