Lines Matching refs:path
27 bool FileOperator::Create(const std::string &path, mode_t mode)
29 auto ret = mkdir(path.c_str(), mode);
31 IMSA_HILOGE("%{public}s mkdir failed, errno:%{public}d!", path.c_str(), errno);
37 bool FileOperator::IsExist(const std::string &path)
39 return access(path.c_str(), F_OK) == SUCCESS;
42 bool FileOperator::Read(const std::string &path, std::string &content)
44 std::ifstream file(path);
46 IMSA_HILOGE("%{public}s open fail!", path.c_str());
56 bool FileOperator::Write(const std::string &path, const std::string &content, int32_t flags, mode_t mode)
59 auto fd = open(path.c_str(), flags, mode);
61 IMSA_HILOGE("%{public}s open fail, errno: %{public}d", path.c_str(), errno);
66 IMSA_HILOGE("%{public}s write fail, ret: %{public}zd, errno: %{public}d", path.c_str(), ret, errno);
74 bool FileOperator::Read(const std::string &path, const std::string &key, std::string &content)
80 CfgFiles *cfgFiles = GetCfgFiles(path.c_str());
82 IMSA_HILOGE("%{public}s cfgFiles is nullptr!", path.c_str());
100 std::string FileOperator::Read(const std::string &path, const std::string &key)
103 bool ret = Read(path, content);
105 IMSA_HILOGE("%{public}s read failed!", path.c_str());
109 IMSA_HILOGD("%{public}s not contain %{public}s!", path.c_str(), key.c_str());
115 std::string FileOperator::GetRealPath(const char *path)
117 if (path == nullptr) {
120 auto size = strnlen(path, PATH_MAX);
125 if (realpath(path, realPath) == nullptr) {