Home
last modified time | relevance | path

Searched refs:fileName (Results 1 – 25 of 273) sorted by relevance

1234567891011

/base/hiviewdfx/faultloggerd/test/systemtest/
Dfaultloggerd_system_test.cpp302 string fileName; variable
303 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName);
304 GTEST_LOG_(INFO) << "test pid(" << pid << ")" << " cppcrash file name : " << fileName;
305 if (pid < 0 || fileName.size() < CPPCRASH_FILENAME_MIN_LENGTH) {
309 EXPECT_TRUE(CheckCountNum(fileName, pid, cmd)) << "ProcessDfxRequestTest001 Failed";
322 string fileName; variable
323 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName);
324 GTEST_LOG_(INFO) << "test pid(" << pid << ")" << " cppcrash file name : " << fileName;
325 if (pid < 0 || fileName.size() < CPPCRASH_FILENAME_MIN_LENGTH) {
329 EXPECT_TRUE(CheckCountNum(fileName, pid, cmd)) << "FaultLoggerdSystemTest002 Failed";
[all …]
/base/security/huks/test/unittest/huks_lite_test/common/
Dhks_test_file_operator.c30 static int32_t GetFullFileName(const char *path, const char *fileName, char **fullFileName) in GetFullFileName() argument
39 int32_t ret = GetFileName(path, fileName, tmpFileName, nameLen); in GetFullFileName()
52 int32_t HksTestIsFileExist(const char *path, const char *fileName) in HksTestIsFileExist() argument
54 if (fileName == NULL) { in HksTestIsFileExist()
59 int32_t ret = GetFullFileName(path, fileName, &fullFileName); in HksTestIsFileExist()
69 static int32_t FileRead(const char *fileName, uint32_t offset, struct HksBlob *blob, uint32_t *size) in FileRead() argument
77 int32_t ret = UtilsFileStat(fileName, &fileSize); in FileRead()
88 int fd = UtilsFileOpen(fileName, O_RDONLY_FS, 0); in FileRead()
103 static int32_t FileWrite(const char *fileName, uint32_t offset, const uint8_t *buf, uint32_t len) in FileWrite() argument
110 int fd = UtilsFileOpen(fileName, O_CREAT_FS | O_TRUNC_FS | O_RDWR_FS, 0); in FileWrite()
[all …]
/base/security/huks/utils/file_operator/
Dhks_file_operator_lite.c51 static int32_t GetFileName(const char *path, const char *fileName, char *fullFileName, uint32_t ful… in GetFileName() argument
64 if (strncat_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
68 if (strncpy_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
76 static int32_t GetFullFileName(const char *path, const char *fileName, char **fullFileName) in GetFullFileName() argument
83 int32_t ret = GetFileName(path, fileName, tmpFileName, nameLen); in GetFullFileName()
95 static int32_t IsFileExist(const char *fileName) in IsFileExist() argument
98 int32_t ret = stat(fileName, &fileStat); in IsFileExist()
111 static int32_t FileRead(const char *fileName, uint32_t offset, struct HksBlob *blob, uint32_t *size) in FileRead() argument
114 int32_t fd = open(fileName, O_RDONLY); in FileRead()
136 static uint32_t FileSize(const char *fileName) in FileSize() argument
[all …]
Dhks_file_operator.c36 static int32_t GetFileName(const char *path, const char *fileName, char *fullFileName, uint32_t ful… in GetFileName() argument
49 if (strncat_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
53 if (strncpy_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
61 static int32_t GetFullFileName(const char *path, const char *fileName, char **fullFileName) in GetFullFileName() argument
68 int32_t ret = GetFileName(path, fileName, tmpFileName, nameLen); in GetFullFileName()
79 static int32_t IsFileExist(const char *fileName) in IsFileExist() argument
81 if (access(fileName, F_OK) != 0) { in IsFileExist()
88 static int32_t FileRead(const char *fileName, uint32_t offset, struct HksBlob *blob, uint32_t *size) in FileRead() argument
91 HKS_IF_NOT_SUCC_RETURN(IsFileExist(fileName), HKS_ERROR_NOT_EXIST) in FileRead()
93 if (strstr(fileName, "../") != NULL) { in FileRead()
[all …]
Dhks_file_operator.h66 char fileName[HKS_MAX_DIRENT_FILE_LEN]; /* point to dirent->d_name */ member
84 int32_t HksFileRead(const char *path, const char *fileName, uint32_t offset, struct HksBlob *blob, …
86 int32_t HksFileWrite(const char *path, const char *fileName, uint32_t offset, const uint8_t *buf, u…
88 int32_t HksFileRemove(const char *path, const char *fileName);
90 uint32_t HksFileSize(const char *path, const char *fileName);
92 int32_t HksIsFileExist(const char *path, const char *fileName);
109 int32_t HksOldVersionFileRead(const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len);
111 int32_t HksOldVersionFileRemove(const char *fileName);
114 int32_t HksOldVersionFileSize(const char *fileName);
117 bool HksOldVersionIsFileExist(const char *fileName);
[all …]
/base/security/huks/test/unittest/huks_common_test/src/
Dhks_test_file_operator_func.c19 int32_t GetFileName(const char *path, const char *fileName, char *fullFileName, uint32_t fullFileNa… in GetFileName() argument
32 if (strncat_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
36 if (strncpy_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
44 int32_t IsFileExist(const char *fileName) in IsFileExist() argument
46 if (access(fileName, F_OK) != 0) { in IsFileExist()
53 int32_t FileRead(const char *fileName, uint32_t offset, struct HksBlob *blob, uint32_t *size) in FileRead() argument
56 if (IsFileExist(fileName) != HKS_SUCCESS) { in FileRead()
61 (void)realpath(fileName, filePath); in FileRead()
86 uint32_t FileSize(const char *fileName) in FileSize() argument
88 if (IsFileExist(fileName) != HKS_SUCCESS) { in FileSize()
[all …]
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/
Dhks_test_file_operator.c20 static int32_t GetFullFileName(const char *path, const char *fileName, char **fullFileName) in GetFullFileName() argument
29 int32_t ret = GetFileName(path, fileName, tmpFileName, nameLen); in GetFullFileName()
40 int32_t HksIsFileExist(const char *path, const char *fileName) in HksIsFileExist() argument
43 if (fileName == NULL) { in HksIsFileExist()
47 int32_t ret = GetFullFileName(path, fileName, &fullFileName); in HksIsFileExist()
57 int32_t HksFileRead(const char *path, const char *fileName, uint32_t offset, struct HksBlob *blob, … in HksFileRead() argument
60 …if ((fileName == NULL) || (blob == NULL) || (blob->data == NULL) || (blob->size == 0) || (size == … in HksFileRead()
64 int32_t ret = GetFullFileName(path, fileName, &fullFileName); in HksFileRead()
74 int32_t HksFileWrite(const char *path, const char *fileName, uint32_t offset, const uint8_t *buf, u… in HksFileWrite() argument
77 if ((fileName == NULL) || (buf == NULL) || (len == 0)) { in HksFileWrite()
[all …]
/base/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/src/
Dcert_manager_file_operator.c32 static int32_t GetFileName(const char *path, const char *fileName, char *fullFileName, uint32_t ful… in GetFileName() argument
45 if (strncat_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
49 if (strncpy_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
56 static int32_t GetFullFileName(const char *path, const char *fileName, char **fullFileName) in GetFullFileName() argument
65 int32_t ret = GetFileName(path, fileName, tmpFileName, nameLen); in GetFullFileName()
76 static int32_t IsFileExist(const char *fileName) in IsFileExist() argument
78 if (access(fileName, F_OK) != 0) { in IsFileExist()
93 static uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len) in FileRead() argument
96 if (IsFileExist(fileName) != CMR_OK) { in FileRead()
99 if (strstr(fileName, "../") != NULL) { in FileRead()
[all …]
/base/hiviewdfx/hiview/adapter/service/idl/test/unittest/common/
Dadapter_loglibrary_ability_test.cpp58 std::string fileName = "AbilityList.txt"; variable
59 FileUtil::SaveStringToFile(SOURCE_PATH + fileName, "AbilityListtestcontent", true);
76 std::string fileName = "AbilityCopy.txt"; variable
77 FileUtil::SaveStringToFile(SOURCE_PATH + fileName, "AbilityCopytestcontent", true);
79 int32_t result = ability.Copy(LOG_TYPE, fileName, DEST_PATH);
85 std::string fileName = "AbilityCopy.txt"; variable
87 int32_t result = ability.Copy(NON_LOG_TYPE, fileName, DEST_PATH);
93 std::string fileName = "AbilityMove.txt"; variable
94 FileUtil::SaveStringToFile(SOURCE_PATH + fileName, "AbilityMovetestcontent", true);
96 int32_t result = ability.Move(LOG_TYPE, fileName, DEST_PATH);
[all …]
Dadapter_loglibrary_idl_test.cpp51 std::string fileName = "List.txt"; variable
52 FileUtil::SaveStringToFile(SOURCE_PATH + fileName, "listtestcontent", true);
60 std::string fileName = "Copy.txt"; variable
61 FileUtil::SaveStringToFile(SOURCE_PATH + fileName, "copytestcontent", true);
62 int32_t result = HiviewServiceAgent::GetInstance().Copy(LOG_TYPE, fileName, DEST_PATH);
68 std::string fileName = "Move.txt"; variable
69 FileUtil::SaveStringToFile(SOURCE_PATH + fileName, "movetestcontent", true);
70 int32_t result = HiviewServiceAgent::GetInstance().Move(LOG_TYPE, fileName, DEST_PATH);
76 std::string fileName = "Reove.txt"; variable
77 FileUtil::SaveStringToFile(SOURCE_PATH + fileName, "removetestcontent", true);
[all …]
/base/account/os_account/frameworks/common/test/unittest/common_account_test/
Daccount_log_test.cpp80 std::string fileName = "../base/account/test.cpp"; variable
87 std::string result = AccountLogWrapper::GetBriefFileName(fileName);
99 std::string fileName = "test.cpp"; variable
100 std::string result = AccountLogWrapper::GetBriefFileName(fileName);
101 EXPECT_EQ(fileName, result);
102 fileName = "";
103 result = AccountLogWrapper::GetBriefFileName(fileName);
104 EXPECT_EQ(fileName, result);
118 std::string fileName = "\\test.cpp"; variable
125 std::string result = AccountLogWrapper::GetBriefFileName(fileName);
/base/startup/init/test/unittest/init/
Dservice_file_unittest.cpp42 const char *fileName = "/data/filetest"; variable
43 ServiceFile *fileOpt = (ServiceFile *)calloc(1, sizeof(ServiceFile) + strlen(fileName) + 1);
51 int ret = strncpy_s(fileOpt->fileName, strlen(fileName) + 1, fileName, strlen(fileName));
60 ret = strncpy_s(fileOpt->fileName, strlen(fileName) + 1, "fileName", strlen("fileName"));
65 …ret = strncpy_s(fileOpt->fileName, strlen(fileName) + 1, "/dev/filetest", strlen("/dev/filetest"));
/base/tee/tee_client/services/tlogcat/src/
Dtarzip.c80 static void WriteHeader(struct TagHeader *header, const char *fileName, long fileSize) in WriteHeader() argument
90 if (fileName == NULL || fileSize == 0) { in WriteHeader()
94 nameLen = strlen(fileName); in WriteHeader()
97 sumAppend += WriteOneUint(j, nameLen, fileName, index); in WriteHeader()
129 static void WriteZipContent(gzFile gzFd, const char *fileName, long fileSize) in WriteZipContent() argument
135 bool cond = (gzFd == NULL || fileName == NULL || fileSize == 0); in WriteZipContent()
142 int32_t fileFd = open(fileName, O_CREAT | O_RDWR, ZIP_OPEN_MODE); in WriteZipContent()
221 static int32_t WriteSingleFile(const char *fileName, gzFile out) in WriteSingleFile() argument
228 if (!JudgeFileValidite(fileName, &fileAttr)) { in WriteSingleFile()
233 s1 = strrchr(fileName, '/'); in WriteSingleFile()
[all …]
/base/security/huks/test/unittest/huks_common_test/include/
Dhks_test_file_operator_c.h34 int32_t GetFileName(const char *path, const char *fileName, char *fullFileName, uint32_t fullFileNa…
36 int32_t IsFileExist(const char *fileName);
38 int32_t FileRead(const char *fileName, uint32_t offset, struct HksBlob *blob, uint32_t *size);
40 uint32_t FileSize(const char *fileName);
42 int32_t FileWrite(const char *fileName, uint32_t offset, const uint8_t *buf, uint32_t len);
/base/security/huks/test/unittest/huks_lite_test/common/include/
Dhks_test_file_operator.h25 int32_t HksTestIsFileExist(const char *path, const char *fileName);
27 uint32_t HksTestFileSize(const char *path, const char *fileName);
29 int32_t HksTestFileRead(const char *path, const char *fileName, uint32_t offset, struct HksBlob *bl…
31 int32_t HksTestFileWrite(const char *path, const char *fileName, uint32_t offset, const uint8_t *bu…
33 int32_t HksTestFileRemove(const char *path, const char *fileName);
/base/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/include/
Dcert_manager_file_operator.h30 char fileName[CM_MAX_DIRENT_FILE_LEN]; /* point to dirent->d_name */ member
33 uint32_t CmFileRead(const char *path, const char *fileName, uint32_t offset, uint8_t *buf, uint32_t…
35 int32_t CmFileWrite(const char *path, const char *fileName, uint32_t offset, const uint8_t *buf, ui…
38 const char *path, const char *fileName, uint32_t offset, const uint8_t *buf, uint32_t len);
40 int32_t CmFileRemove(const char *path, const char *fileName);
42 uint32_t CmFileSize(const char *path, const char *fileName);
44 int32_t CmIsFileExist(const char *path, const char *fileName);
/base/notification/distributed_notification_service/frameworks/ans/test/unittest/
Dans_log_test.cpp52 std::string fileName = "../function/EventFwk/test.cpp"; variable
55 std::string result = AnsLogWrapper::GetBriefFileName(fileName.c_str());
67 std::string fileName = "test.cpp"; variable
70 std::string result = AnsLogWrapper::GetBriefFileName(fileName.c_str());
73 fileName = "";
74 result = AnsLogWrapper::GetBriefFileName(fileName.c_str());
/base/update/updater/services/applypatch/
Dstore.cpp47 int32_t Store::FreeStore(const std::string &dirPath, const std::string &fileName) in FreeStore() argument
49 if (dirPath.empty() || fileName.empty()) { in FreeStore()
52 std::string path = dirPath + "/" + fileName; in FreeStore()
100 int32_t Store::WriteDataToStore(const std::string &dirPath, const std::string &fileName, in WriteDataToStore() argument
107 if (!fileName.empty()) { in WriteDataToStore()
110 std::string path = pathTmp + fileName; in WriteDataToStore()
111 pathTmp = pathTmp + fileName; in WriteDataToStore()
142 int32_t Store::LoadDataFromStore(const std::string &dirPath, const std::string &fileName, in LoadDataFromStore() argument
145 LOG(INFO) << "Store base is " << dirPath << "/" << fileName; in LoadDataFromStore()
147 if (!fileName.empty()) { in LoadDataFromStore()
[all …]
/base/update/updateservice/services/core/ability/utils/src/
Dsha256_utils.cpp44 bool Sha256Utils::CheckFileSha256String(const std::string &fileName, const std::string &sha256Strin… in CheckFileSha256String() argument
46 if (!FileUtils::IsFileExist(fileName)) { in CheckFileSha256String()
47 … ENGINE_LOGE("check file sha256 failed, fileName = %{pubilc}s is not exist", fileName.c_str()); in CheckFileSha256String()
51 if (!GetFileSha256Str(fileName, sha256Result, sizeof(sha256Result))) { in CheckFileSha256String()
62 bool Sha256Utils::GetDigestFromFile(const char *fileName, unsigned char digest[]) in GetDigestFromFile() argument
64 char *canonicalPath = realpath(fileName, NULL); in GetDigestFromFile()
66 ENGINE_LOGI("%s is not exist or invalid", fileName); in GetDigestFromFile()
86 ENGINE_LOGE("read file %{public}s error", fileName); in GetDigestFromFile()
98 bool Sha256Utils::GetFileSha256Str(const std::string &fileName, char *sha256Result, uint32_t len) in GetFileSha256Str() argument
101 GetDigestFromFile(fileName.c_str(), digest); in GetFileSha256Str()
/base/update/updater/services/diffpatch/
Ddiffpatch.cpp30 int32_t WriteDataToFile(const std::string &fileName, const std::vector<uint8_t> &data, size_t dataS… in WriteDataToFile() argument
32 std::ofstream patchFile(fileName, std::ios::out | std::ios::binary); in WriteDataToFile()
34 PATCH_LOGE("Failed to open %s", fileName.c_str()); in WriteDataToFile()
42 int32_t PatchMapFile(const std::string &fileName, MemMapInfo &info) in PatchMapFile() argument
46 if (_fullpath(realPath, fileName.c_str(), PATH_MAX) == nullptr) { in PatchMapFile()
48 if (realpath(fileName.c_str(), realPath) == nullptr) { in PatchMapFile()
50 PATCH_LOGE("Failed to get realpath %s", fileName.c_str()); in PatchMapFile()
55 PATCH_LOGE("Failed to open file %s", fileName.c_str()); in PatchMapFile()
/base/sensors/miscdevice/utils/common/src/
Dfile_utils.cpp102 int32_t GetFileName(const int32_t &fd, std::string &fileName) in GetFileName() argument
123 fileName = filePath; in GetFileName()
124 std::size_t firstSlash = fileName.rfind("/"); in GetFileName()
125 if (firstSlash == fileName.npos) { in GetFileName()
129 fileName = fileName.substr(firstSlash + 1, fileName.size() - firstSlash); in GetFileName()
139 std::string fileName = ""; in GetFileExtName() local
140 if (GetFileName(fd, fileName) == ERROR) { in GetFileExtName()
144 extName = fileName.substr(fileName.find_last_of(".") + 1); in GetFileExtName()
177 bool IsFileExists(const std::string &fileName) in IsFileExists() argument
179 return (access(fileName.c_str(), F_OK) == 0); in IsFileExists()
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/include/
Dhks_test_file_operator.h25 int32_t HksIsFileExist(const char *path, const char *fileName);
27 uint32_t HksFileSize(const char *path, const char *fileName);
29 int32_t HksFileRead(const char *path, const char *fileName, uint32_t offset, struct HksBlob *blob, …
31 int32_t HksFileWrite(const char *path, const char *fileName, uint32_t offset, const uint8_t *buf, u…
/base/telephony/sms_mms/frameworks/native/mms/src/
Dmms_content_param.cpp69 void MmsContentParam::GetFileName(std::string &fileName) in GetFileName() argument
71 fileName = ""; in GetFileName()
74 fileName = textMap_[fieldCode]; in GetFileName()
79 fileName = textMap_[fieldCode]; in GetFileName()
84 fileName = textMap_[fieldCode]; in GetFileName()
89 fileName = textMap_[fieldCode]; in GetFileName()
93 void MmsContentParam::SetFileName(std::string fileName) in SetFileName() argument
95 if (fileName.empty()) { in SetFileName()
99 textMap_.insert(std::make_pair(fieldCode, fileName)); in SetFileName()
/base/startup/init/services/param/adapter/
Dparam_dac.c183 static int LoadParamLabels(const char *fileName) in LoadParamLabels() argument
189 PARAM_LOGE("Failed to alloc memory %s", fileName); in LoadParamLabels()
193 FILE *fp = fopen(fileName, "r"); in LoadParamLabels()
200 … PARAM_LOGE("Failed to split string %s fileName %s, result is:%d", buff, fileName, result); in LoadParamLabels()
207 PARAM_LOGI("Load parameter label total %u success %s", infoCount, fileName); in LoadParamLabels()
222 static int ProcessParamFile(const char *fileName, void *context) in ProcessParamFile() argument
225 return LoadParamLabels(fileName); in ProcessParamFile()
239 char *fileName = malloc(MAX_BUF_SIZE); in DacGetParamSecurityLabel() local
240 PARAM_CHECK(fileName != NULL, closedir(pDir); in DacGetParamSecurityLabel()
256 int ret = PARAM_SPRINTF(fileName, MAX_BUF_SIZE, "%s/%s", path, dp->d_name); in DacGetParamSecurityLabel()
[all …]
/base/startup/init/services/init/
Dinit_service_file.c35 INIT_CHECK(file != NULL && file->fileName != NULL, return -1); in CreateFile()
37 if (realpath(file->fileName, path) == NULL) { in CreateFile()
39 …INIT_ERROR_CHECK(strncpy_s(path, strlen(file->fileName) + 1, file->fileName, strlen(file->fileName in CreateFile()
81 … INIT_LOGE("Service error %d %s, failed to create file", errno, service->name, tmpFile->fileName); in CreateServiceFile()
85 if (SetFileEnv(fd, tmpFile->fileName) != 0) { in CreateServiceFile()
87 …T_LOGE("Service error %d %s, failed to set env for file", errno, service->name, tmpFile->fileName); in CreateServiceFile()

1234567891011