#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
+#include <fstream>
+#include <string>
+#include <iostream>
+
namespace OHOS
{
path.c_str());
}
}
+
+ // 检查文件是否可打开并且不为空
+ bool IsFileAccessibleAndNotEmpty(const std::string& filePath) {
+ std::ifstream file(filePath);
+ return file.is_open() && file.peek() != std::ifstream::traits_type::eof();
+ }
}