Home
last modified time | relevance | path

Searched refs:filePath (Results 1 – 25 of 203) sorted by relevance

123456789

/base/sensors/miscdevice/utils/src/
Dfile_utils.cpp36 std::string ReadJsonFile(const std::string &filePath) in ReadJsonFile() argument
38 if (filePath.empty()) { in ReadJsonFile()
43 if (realpath(filePath.c_str(), realPath) == nullptr) { in ReadJsonFile()
66 int32_t GetFileSize(const std::string& filePath) in GetFileSize() argument
69 if (stat(filePath.c_str(), &statbuf) != 0) { in GetFileSize()
90 bool CheckFileDir(const std::string& filePath, const std::string& dir) in CheckFileDir() argument
92 if (filePath.compare(0, CONFIG_DIR.size(), CONFIG_DIR) != 0) { in CheckFileDir()
99 bool CheckFileSize(const std::string& filePath) in CheckFileSize() argument
101 int32_t fileSize = GetFileSize(filePath); in CheckFileSize()
109 bool CheckFileExtendName(const std::string& filePath, const std::string& checkExtension) in CheckFileExtendName() argument
[all …]
/base/customization/config_policy/test/unittest/
Dconfig_policy_utils_test.cpp46 char *filePath = nullptr; in TestGetCfgFile() local
48 filePath = cfgFiles->paths[i]; in TestGetCfgFile()
49 if (filePath && *filePath != '\0') { in TestGetCfgFile()
50 std::cout << "type: " << type << ", filePath: " << filePath << std::endl; in TestGetCfgFile()
56 filePath = GetOneCfgFileEx(testPathSuffix, buf, MAX_PATH_LEN, type, extra); in TestGetCfgFile()
57 if (filePath && *filePath != '\0') { in TestGetCfgFile()
58 std::cout << "type: " << type << ", one filePath: " << filePath << std::endl; in TestGetCfgFile()
124 char *filePath = cfgDir->paths[i]; variable
125 if (filePath && *filePath != '\0') {
126 std::cout << "filePath: " << filePath << std::endl;
/base/msdp/device_status/libs/src/
Ddevicestatus_data_parse.cpp123 std::string DeviceStatusDataParse::ReadJsonFile(const std::string &filePath) in ReadJsonFile() argument
125 if (filePath.empty()) { in ReadJsonFile()
130 if (realpath(filePath.c_str(), realPath) == nullptr) { in ReadJsonFile()
142 if (!Utility::DoesFileExist(filePath.c_str())) { in ReadJsonFile()
146 if (!CheckFileSize(filePath)) { in ReadJsonFile()
153 int32_t DeviceStatusDataParse::GetFileSize(const std::string& filePath) in GetFileSize() argument
156 if (stat(filePath.c_str(), &statbuf) != 0) { in GetFileSize()
163 bool DeviceStatusDataParse::CheckFileDir(const std::string& filePath, const std::string& dir) in CheckFileDir() argument
165 if (filePath.compare(0, MSDP_DATA_DIR.size(), MSDP_DATA_DIR) != 0) { in CheckFileDir()
172 bool DeviceStatusDataParse::CheckFileSize(const std::string& filePath) in CheckFileSize() argument
[all …]
/base/sensors/miscdevice/utils/include/
Dfile_utils.h29 std::string ReadJsonFile(const std::string &filePath);
30 std::string ReadFile(const std::string &filePath);
31 bool CheckFileDir(const std::string& filePath, const std::string& dir);
32 bool CheckFileExtendName(const std::string& filePath, const std::string& checkExtension);
33 bool CheckFileSize(const std::string& filePath);
35 int32_t GetFileSize(const std::string& filePath);
/base/msdp/device_status/libs/include/
Ddevicestatus_data_parse.h37 int32_t GetFileSize(const std::string& filePath);
38 bool CheckFileDir(const std::string& filePath, const std::string& dir);
39 bool CheckFileSize(const std::string& filePath);
40 bool CheckFileExtendName(const std::string& filePath, const std::string& checkExtension);
41 std::string ReadFile(const std::string &filePath);
42 std::string ReadJsonFile(const std::string &filePath);
/base/request/request/test/unittest/common/napi/requestTest/
DRequestJsunit.test.js60 filePath: `/data/storage/el2/base/haps/entry/files/`, property
65 downloadConfig.filePath += 'SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0001.txt'
111 filePath: `/data/storage/el2/base/haps/entry/files/`, property
116 downloadConfig.filePath += 'SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0002.txt'
155 filePath: `/data/storage/el2/base/haps/entry/files/`, property
160 downloadConfig.filePath += 'SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0003.txt'
205 filePath: `/data/storage/el2/base/haps/entry/files/`, property
210 downloadConfig.filePath += 'SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0004.txt'
254 filePath: `/data/storage/el2/base/haps/entry/files/`, property
259 downloadConfig.filePath += 'SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0005.txt'
[all …]
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/
Dhks_test_file_operator.c95 char filePath[PATH_MAX + 1] = {0}; in FileRead() local
96 (void)realpath(fileName, filePath); in FileRead()
97 if (strstr(filePath, "../") != NULL) { in FileRead()
98 HKS_TEST_LOG_E("invalid filePath, path %s", filePath); in FileRead()
102 FILE *fp = fopen(filePath, "rb"); in FileRead()
136 char filePath[PATH_MAX + 1] = {0}; in FileWrite() local
137 if (memcpy_s(filePath, sizeof(filePath) - 1, fileName, strlen(fileName)) != EOK) { in FileWrite()
140 (void)realpath(fileName, filePath); in FileWrite()
141 if (strstr(filePath, "../") != NULL) { in FileWrite()
142 HKS_TEST_LOG_E("invalid filePath, path %s", filePath); in FileWrite()
[all …]
/base/request/request/frameworks/js/napi/src/upload/
Dobtain_file.cpp94 bool ObtainFile::IsValidPath(const std::string &filePath) in IsValidPath() argument
97 if (filePath.length() > PATH_MAX || realpath(filePath.c_str(), resolvedPath) == nullptr || in IsValidPath()
98 strncmp(resolvedPath, filePath.c_str(), filePath.length()) != 0) { in IsValidPath()
124 std::string filePath = fileAdapter_->InternalGetFilePath(context); in GetInternalFile() local
125 if (filePath.empty()) { in GetInternalFile()
129 filePath += "/" + fileName; in GetInternalFile()
130 if (!IsValidPath(filePath)) { in GetInternalFile()
133 FILE *filePtr = fopen(filePath.c_str(), "r"); in GetInternalFile()
/base/hiviewdfx/blackbox/
Dblackbox_detector.c18 int UploadEventByFile(const char *filePath) in UploadEventByFile() argument
20 if (filePath == NULL) { in UploadEventByFile()
21 BBOX_PRINT_ERR("filePath: %p\n", filePath); in UploadEventByFile()
/base/hiviewdfx/hiappevent/frameworks/native/libhiappevent/utility/
Dfile_util.cpp91 std::string filePath = GetFilePathByDir(dir, dirInfo->d_name); in ForceRemoveDirectory() local
92 if (!ForceRemoveDirectory(filePath)) { in ForceRemoveDirectory()
119 std::string filePath = GetFilePathByDir(dir, ent->d_name); in GetDirFiles() local
120 if (IsFile(filePath)) { // do not process subdirectory in GetDirFiles()
121 files.push_back(filePath); in GetDirFiles()
177 std::string filePath = dir; in GetFilePathByDir() local
178 if (filePath.back() != '/') { in GetFilePathByDir()
179 filePath.push_back(PATH_DELIMITER); in GetFilePathByDir()
181 filePath.append(fileName); in GetFilePathByDir()
182 return filePath; in GetFilePathByDir()
/base/hiviewdfx/hiview/base/event_store/store/
Dsys_event_doc.cpp127 std::string filePath = GetCurFile(dir); in UpdateCurFile() local
128 if (filePath.empty() || IsFileFull(filePath)) { in UpdateCurFile()
131 curFile_ = filePath; in UpdateCurFile()
169 std::string filePath = dir + FILE_SEPARATOR; in CreateCurFile() local
170filePath.append(name_).append(FILE_NAME_SEPARATOR).append(std::to_string(type_)).append(FILE_NAME_… in CreateCurFile()
172 …if (FileUtil::CreateFile(filePath, FileUtil::FILE_PERM_660) != 0 && !FileUtil::FileExists(filePath in CreateCurFile()
173 HIVIEW_LOGE("failed to create file=%{public}s, errno=%{public}d", filePath.c_str(), errno); in CreateCurFile()
176 curFile_ = filePath; in CreateCurFile()
/base/security/huks/test/unittest/huks_lite_test/common/
Dhks_test_file_operator.c105 char filePath[PATH_MAX + 1] = {0}; in FileRead() local
106 (void)realpath(fileName, filePath); in FileRead()
107 if (strstr(filePath, "../") != NULL) { in FileRead()
108 HKS_TEST_LOG_E("invalid filePath, path %s", filePath); in FileRead()
112 FILE *fp = fopen(filePath, "rb"); in FileRead()
146 char filePath[PATH_MAX + 1] = {0}; in FileWrite() local
147 if (memcpy_s(filePath, sizeof(filePath) - 1, fileName, strlen(fileName)) != EOK) { in FileWrite()
150 (void)realpath(fileName, filePath); in FileWrite()
151 if (strstr(filePath, "../") != NULL) { in FileWrite()
152 HKS_TEST_LOG_E("invalid filePath, path %s", filePath); in FileWrite()
[all …]
/base/update/sys_installer/services/module_update/util/src/
Dmodule_utils.cpp93 std::string GetHmpName(const std::string &filePath) in GetHmpName() argument
95 std::size_t endPos = filePath.find_last_of('/'); in GetHmpName()
97 LOG(ERROR) << "Invalid package path " << filePath; in GetHmpName()
103 if (StartsWith(filePath, iter)) { in GetHmpName()
109 LOG(ERROR) << "Invalid package path " << filePath; in GetHmpName()
112 return filePath.substr(startPos, endPos - startPos); in GetHmpName()
182 std::string GetRealPath(const std::string &filePath) in GetRealPath() argument
185 if (realpath(filePath.c_str(), path) == nullptr) { in GetRealPath()
186 LOG(ERROR) << "get real path fail " << filePath; in GetRealPath()
/base/update/updateservice/services/core/ability/utils/src/
Dfile_utils.cpp53 bool FileUtils::IsSpaceEnough(const std::string &filePath, const int64_t requiredSpace) in IsSpaceEnough() argument
57 const std::filesystem::space_info spaceInfo = std::filesystem::space(filePath, errorCode); in IsSpaceEnough()
62 ENGINE_LOGI("free space of [%s] is [%lu]", filePath.c_str(), (unsigned long long)freeSpace); in IsSpaceEnough()
69 bool FileUtils::SaveDataToFile(const std::string &filePath, const std::string &data) in SaveDataToFile() argument
72 os.open(filePath, std::ios::trunc); in SaveDataToFile()
74 ENGINE_LOGI("SaveDataToFile success, file = %{public}s", filePath.c_str()); in SaveDataToFile()
79 ENGINE_LOGE("SaveDataToFile fail, file = %{public}s", filePath.c_str()); in SaveDataToFile()
205 std::string FileUtils::ReadDataFromFile(const std::string &filePath) in ReadDataFromFile() argument
208 readFile.open(filePath); in ReadDataFromFile()
210 ENGINE_LOGI("open file from %{public}s err", filePath.c_str()); in ReadDataFromFile()
/base/msdp/device_status/utils/common/src/
Dutil.cpp224 bool CheckFileExtendName(const std::string &filePath, const std::string &checkExtension) in CheckFileExtendName() argument
226 std::string::size_type pos = filePath.find_last_of('.'); in CheckFileExtendName()
231 return (filePath.substr(pos + 1, filePath.npos) == checkExtension); in CheckFileExtendName()
234 int32_t GetFileSize(const std::string &filePath) in GetFileSize() argument
237 if (stat(filePath.c_str(), &statbuf) != 0) { in GetFileSize()
244 bool IsValidPath(const std::string &rootDir, const std::string &filePath) in IsValidPath() argument
246 return (filePath.compare(0, rootDir.size(), rootDir) == 0); in IsValidPath()
249 bool IsValidSvgPath(const std::string &filePath) in IsValidSvgPath() argument
251 return IsValidPath(SVG_PATH, filePath); in IsValidSvgPath()
254 bool IsValidSvgFile(const std::string &filePath) in IsValidSvgFile() argument
[all …]
/base/update/sys_installer/test/fuzztest/
Dsys_installer_fuzzer.cpp112 std::string filePath; in CreatePackageZip() local
116 filePath = TEST_PATH_TO; in CreatePackageZip()
117 filePath += fstabFile[i].c_str(); in CreatePackageZip()
118 comp[i].filePath = strdup(filePath.c_str()); in CreatePackageZip()
121 ret = BuildFileDigest(*comp[i].digest, sizeof(comp[i].digest), filePath); in CreatePackageZip()
122 comp[i].size = GetFileSize(filePath); in CreatePackageZip()
128 filePath.clear(); in CreatePackageZip()
136 free(comp[i].filePath); in CreatePackageZip()
/base/hiviewdfx/hisysevent/adapter/native/idl/src/
Dfile_util.cpp81 std::string filePath = dir; in GetFilePathByDir() local
82 if (filePath.back() != '/') { in GetFilePathByDir()
83 filePath.push_back(PATH_DELIMITER); in GetFilePathByDir()
85 filePath.append(fileName); in GetFilePathByDir()
86 return filePath; in GetFilePathByDir()
/base/security/appverify/interfaces/innerkits/appverify/test/unittest/src/
Drandom_access_file_test.cpp71 std::string filePath = "./test_hapverify.zip"; variable
73 int32_t sumLen = CreatTestZipFile(filePath, si0);
75 bool initRet = hapTestFile1.Init(filePath);
88 filePath = "./test_hapverify1.zip";
90 initRet = nullTestFile.Init(filePath);
/base/update/updater/test/fuzztest/UpdaterStartUpdaterProc_fuzzer/
DUpdaterStartUpdaterProc_fuzzer.cpp122 std::string filePath; in CreatePackageZip() local
126 filePath = TEST_PATH_TO; in CreatePackageZip()
127 filePath += fstabFile[i].c_str(); in CreatePackageZip()
128 comp[i].filePath = strdup(filePath.c_str()); in CreatePackageZip()
131 ret = BuildFileDigest(*comp[i].digest, sizeof(comp[i].digest), filePath); in CreatePackageZip()
132 comp[i].size = GetFileSize(filePath); in CreatePackageZip()
138 filePath.clear(); in CreatePackageZip()
149 free(comp[i].filePath); in CreatePackageZip()
/base/security/device_auth/deps_adapter/os_adapter/impl/src/liteos/small/
Ddev_auth_dynamic_load.c21 void *DevAuthDlopen(const char *filePath) in DevAuthDlopen() argument
23 return LOS_SoLoad(filePath); in DevAuthDlopen()
/base/hiviewdfx/hiview/utility/common_utils/
Dcalc_fingerprint.cpp59 int CalcFingerprint::CalcFileSha(const string& filePath, char *hash, size_t len) in CalcFileSha() argument
61 if (filePath.empty() || hash == nullptr || !FileUtil::IsLegalPath(filePath)) { in CalcFileSha()
65 fp = fopen(filePath.c_str(), "rb"); in CalcFileSha()
/base/hiviewdfx/hidumper_lite/lite/
Dhidumper.c52 char filePath[PATH_MAX_LEN]; member
178 if (strncpy_s(param.filePath, sizeof(param.filePath), in ParameterMatching()
179 argv[TWO_OF_ARGC_PARAMETERS], sizeof(param.filePath) - 1) != EOK) { in ParameterMatching()
193 if (strncpy_s(param.filePath, sizeof(param.filePath), in ParameterMatching()
194 argv[FOUR_OF_ARGC_PARAMETERS], sizeof(param.filePath) - 1) != EOK) { in ParameterMatching()
/base/security/device_auth/deps_adapter/os_adapter/impl/src/linux/
Ddev_auth_dynamic_load.c21 void *DevAuthDlopen(const char *filePath) in DevAuthDlopen() argument
23 return dlopen(filePath, RTLD_LAZY | RTLD_LOCAL); in DevAuthDlopen()
/base/update/updater/services/updater_binary/
Dupdate_partitions.cpp131 int UpdatePartitions::SetNewPartition(const std::string &filePath, const FileInfo *info, Uscript::U… in SetNewPartition() argument
133 std::string tmpPath = "/data/updater" + filePath; in SetNewPartition()
146 ret = env.GetPkgManager()->ExtractFile(filePath, outStream); in SetNewPartition()
189 std::string filePath; in Execute() local
190 int32_t ret = context.GetParam(0, filePath); in Execute()
196 LOG(INFO) << "UpdatePartitions::Execute filePath " << filePath; in Execute()
198 const FileInfo *info = env.GetPkgManager()->GetFileInfo(filePath); in Execute()
204 return SetNewPartition(filePath, info, env); in Execute()
/base/security/appverify/interfaces/innerkits/appverify/src/interfaces/
Dhap_verify.cpp86 int32_t HapVerify(const std::string& filePath, HapVerifyResult& hapVerifyResult) in HapVerify() argument
92 return hapVerifyV2.Verify(filePath, hapVerifyResult); in HapVerify()
95 int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result) in ParseHapProfile() argument
98 return hapVerifyV2.ParseHapProfile(filePath, hapVerifyV1Result); in ParseHapProfile()

123456789