Skip to content

Commit 3fb0588

Browse files
committed
Merge branch 'v3.8.8' of https://github.com/1-newbie/cocos-engine into v3.8.8
2 parents 7804e3a + ac83d6f commit 3fb0588

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

native/cocos/platform/openharmony/FileUtils-OpenHarmony.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,15 @@ long FileUtilsOpenHarmony::getFileSize(const std::string &filepath) {
188188
return 0;
189189
}
190190

191+
if (fullPath[0] == '/') {
192+
struct stat info;
193+
int result = stat(fullPath.c_str(), &info);
194+
if (result != 0) {
195+
return -1;
196+
}
197+
return static_cast<long>(info.st_size);
198+
}
199+
191200
long filesize = 0;
192201
RawFile64 *rawFile = OH_ResourceManager_OpenRawFile64(_nativeResourceManager, fullPath.c_str());
193202
if (rawFile) {

0 commit comments

Comments
 (0)