Home
last modified time | relevance | path

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

12345678910

/base/hiviewdfx/faultloggerd/test/systemtest/
Dfaultloggerd_system_test.cpp268 string fileName; variable
269 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_C, fileName);
270 GTEST_LOG_(INFO) << "test pid(" << pid << ")" << " cppcrash file name : " << fileName;
271 if (pid < 0 || fileName.size() < CPPCRASH_FILENAME_MIN_LENGTH) {
275 EXPECT_TRUE(CheckCountNum(fileName, pid, cmd)) << "ProcessDfxRequestTest001 Failed";
288 string fileName; variable
289 pid_t pid = TriggerCrasherAndGetFileName(cmd, CRASHER_CPP, fileName);
290 GTEST_LOG_(INFO) << "test pid(" << pid << ")" << " cppcrash file name : " << fileName;
291 if (pid < 0 || fileName.size() < CPPCRASH_FILENAME_MIN_LENGTH) {
295 EXPECT_TRUE(CheckCountNum(fileName, pid, cmd)) << "FaultLoggerdSystemTest002 Failed";
[all …]
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/
Dhks_test_file_operator.c34 static int32_t GetFileName(const char *path, const char *fileName, char *fullFileName, uint32_t ful… in GetFileName() argument
47 if (strncat_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
51 if (strncpy_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
59 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 uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len) in FileRead() argument
91 if (IsFileExist(fileName) != HKS_SUCCESS) { in FileRead()
96 (void)realpath(fileName, filePath); in FileRead()
[all …]
/base/security/huks/test/unittest/huks_lite_test/common/
Dhks_test_file_operator.c43 static int32_t GetFileName(const char *path, const char *fileName, char *fullFileName, uint32_t ful… in GetFileName() argument
56 if (strncat_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
60 if (strncpy_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
68 static int32_t GetFullFileName(const char *path, const char *fileName, char **fullFileName) in GetFullFileName() argument
77 int32_t ret = GetFileName(path, fileName, tmpFileName, nameLen); in GetFullFileName()
89 static int32_t IsFileExist(const char *fileName) in IsFileExist() argument
91 if (access(fileName, F_OK) != 0) { in IsFileExist()
98 static uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len) in FileRead() argument
101 if (IsFileExist(fileName) != HKS_SUCCESS) { in FileRead()
106 (void)realpath(fileName, filePath); in FileRead()
[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 uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len) 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.h60 char fileName[HKS_MAX_DIRENT_FILE_LEN]; /* point to dirent->d_name */ member
75 uint32_t HksFileRead(const char *path, const char *fileName, uint32_t offset, uint8_t *buf, uint32_…
77 int32_t HksFileWrite(const char *path, const char *fileName, uint32_t offset, const uint8_t *buf, u…
79 int32_t HksFileRemove(const char *path, const char *fileName);
81 uint32_t HksFileSize(const char *path, const char *fileName);
83 int32_t HksIsFileExist(const char *path, const char *fileName);
100 int32_t HksOldVersionFileRead(const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len);
102 int32_t HksOldVersionFileRemove(const char *fileName);
105 int32_t HksOldVersionFileSize(const char *fileName);
108 bool HksOldVersionIsFileExist(const char *fileName);
[all …]
Dhks_file_operator.c35 static int32_t GetFileName(const char *path, const char *fileName, char *fullFileName, uint32_t ful… in GetFileName() argument
48 if (strncat_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
52 if (strncpy_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
60 static int32_t GetFullFileName(const char *path, const char *fileName, char **fullFileName) in GetFullFileName() argument
67 int32_t ret = GetFileName(path, fileName, tmpFileName, nameLen); in GetFullFileName()
78 static int32_t IsFileExist(const char *fileName) in IsFileExist() argument
80 if (access(fileName, F_OK) != 0) { in IsFileExist()
87 static uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len) in FileRead() argument
90 HKS_IF_NOT_SUCC_RETURN(IsFileExist(fileName), 0) in FileRead()
93 (void)realpath(fileName, filePath); in FileRead()
[all …]
/base/account/os_account/frameworks/common/test/unittest/common_account_test/
Daccount_log_test.cpp72 std::string fileName = "../base/account/test.cpp"; variable
79 std::string result = AccountLogWrapper::GetBriefFileName(fileName);
91 std::string fileName = "test.cpp"; variable
92 std::string result = AccountLogWrapper::GetBriefFileName(fileName);
93 EXPECT_EQ(fileName, result);
94 fileName = "";
95 result = AccountLogWrapper::GetBriefFileName(fileName);
96 EXPECT_EQ(fileName, result);
110 std::string fileName = "\\test.cpp"; variable
117 std::string result = AccountLogWrapper::GetBriefFileName(fileName);
/base/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/src/
Dcert_manager_file_operator.c30 static int32_t GetFileName(const char *path, const char *fileName, char *fullFileName, uint32_t ful… in GetFileName() argument
43 if (strncat_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
47 if (strncpy_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
54 static int32_t GetFullFileName(const char *path, const char *fileName, char **fullFileName) in GetFullFileName() argument
63 int32_t ret = GetFileName(path, fileName, tmpFileName, nameLen); in GetFullFileName()
74 static int32_t IsFileExist(const char *fileName) in IsFileExist() argument
76 if (access(fileName, F_OK) != 0) { in IsFileExist()
91 static uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len) in FileRead() argument
94 if (IsFileExist(fileName) != CMR_OK) { in FileRead()
99 (void)realpath(fileName, filePath); in FileRead()
[all …]
Dcert_manager_file.c25 inline uint32_t CertManagerFileSize(const char *path, const char *fileName) in CertManagerFileSize() argument
27 return CmFileSize(path, fileName); in CertManagerFileSize()
30 inline uint32_t CertManagerFileRead(const char *path, const char *fileName, uint32_t offset, uint8_… in CertManagerFileRead() argument
32 return CmFileRead(path, fileName, offset, buf, len); in CertManagerFileRead()
35 inline int32_t CertManagerFileWrite(const char *path, const char *fileName, in CertManagerFileWrite() argument
38 return CmFileWrite(path, fileName, offset, buf, len); in CertManagerFileWrite()
41 inline int32_t CertManagerFileRemove(const char *path, const char *fileName) in CertManagerFileRemove() argument
43 return CmFileRemove(path, fileName); in CertManagerFileRemove()
126 uint32_t nameSize = strlen(dire.fileName) + 1; /* include '\0' at end */ in GetFileNames()
136 if (sprintf_s((char *)fNames[i].data, nameSize, "%s", dire.fileName) < 0) { in GetFileNames()
/base/startup/init/test/unittest/init/
Dservice_file_unittest.cpp40 const char *fileName = "/data/filetest"; variable
41 ServiceFile *fileOpt = (ServiceFile *)calloc(1, sizeof(ServiceFile) + strlen(fileName) + 1);
49 if (strncpy_s(fileOpt->fileName, strlen(fileName) + 1, fileName, strlen(fileName)) != 0) {
57 if (strncpy_s(fileOpt->fileName, strlen(fileName) + 1, "fileName", strlen("fileName")) != 0) {
65 …if (strncpy_s(fileOpt->fileName, strlen(fileName) + 1, "/dev/filetest", strlen("/dev/filetest")) !…
/base/web/webview/ohos_adapter/datashare_adapter/src/
Ddatashare_adapter_impl.cpp89 std::string fileName = filePath; in GetFileDisplayName() local
90 std::size_t firstSlash = fileName.rfind("/"); in GetFileDisplayName()
91 if (firstSlash == fileName.npos) { in GetFileDisplayName()
92 WVLOG_E("GetFileDisplayName, get error path with %{public}s", fileName.c_str()); in GetFileDisplayName()
95 fileName = fileName.substr(firstSlash + 1, fileName.size() - firstSlash); in GetFileDisplayName()
96 return fileName; in GetFileDisplayName()
/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 uint32_t HksTestFileRead(const char *path, const char *fileName, uint32_t offset, uint8_t *buf, uin…
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/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/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/include/
Dcert_manager_file_operator.h29 char fileName[CM_MAX_DIRENT_FILE_LEN]; /* point to dirent->d_name */ member
32 uint32_t CmFileRead(const char *path, const char *fileName, uint32_t offset, uint8_t *buf, uint32_t…
34 int32_t CmFileWrite(const char *path, const char *fileName, uint32_t offset, const uint8_t *buf, ui…
36 int32_t CmFileRemove(const char *path, const char *fileName);
38 uint32_t CmFileSize(const char *path, const char *fileName);
40 int32_t CmIsFileExist(const char *path, const char *fileName);
Dcert_manager_file.h27 uint32_t CertManagerFileSize(const char *path, const char *fileName);
29 uint32_t CertManagerFileRead(const char *path, const char *fileName, uint32_t offset, uint8_t *buf,…
31 int32_t CertManagerFileWrite(const char *path, const char *fileName, uint32_t offset,
34 int32_t CertManagerFileRemove(const char *path, const char *fileName);
/base/update/updateservice/services/core/ability/utils/src/
Dsha256_utils.cpp43 bool Sha256Utils::CheckFileSha256String(const std::string &fileName, const std::string &sha256Strin… in CheckFileSha256String() argument
45 if (!FileUtils::IsFileExist(fileName)) { in CheckFileSha256String()
46 … ENGINE_LOGE("check file sha256 failed, fileName = %{pubilc}s is not exist", fileName.c_str()); in CheckFileSha256String()
50 if (!GetFileSha256Str(fileName, sha256Result, sizeof(sha256Result))) { in CheckFileSha256String()
61 bool Sha256Utils::GetDigestFromFile(const char *fileName, unsigned char digest[]) in GetDigestFromFile() argument
63 char *canonicalPath = realpath(fileName, NULL); in GetDigestFromFile()
65 ENGINE_LOGI("%s is not exist or invalid", fileName); in GetDigestFromFile()
85 ENGINE_LOGE("read file %{public}s error", fileName); in GetDigestFromFile()
97 bool Sha256Utils::GetFileSha256Str(const std::string &fileName, char *sha256Result, uint32_t len) in GetFileSha256Str() argument
100 GetDigestFromFile(fileName.c_str(), digest); in GetFileSha256Str()
/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 uint32_t HksFileRead(const char *path, const char *fileName, uint32_t offset, uint8_t *buf, uint32_…
31 int32_t HksFileWrite(const char *path, const char *fileName, uint32_t offset, const uint8_t *buf, u…
/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/updater/services/diffpatch/
Ddiffpatch.cpp29 int32_t WriteDataToFile(const std::string &fileName, const std::vector<uint8_t> &data, size_t dataS… in WriteDataToFile() argument
31 std::ofstream patchFile(fileName, std::ios::out | std::ios::binary); in WriteDataToFile()
33 PATCH_LOGE("Failed to open %s", fileName.c_str()); in WriteDataToFile()
41 int32_t PatchMapFile(const std::string &fileName, MemMapInfo &info) in PatchMapFile() argument
45 if (_fullpath(realPath, fileName.c_str(), PATH_MAX) == nullptr) { in PatchMapFile()
47 if (realpath(fileName.c_str(), realPath) == nullptr) { in PatchMapFile()
49 PATCH_LOGE("Failed to get realpath %s", fileName.c_str()); in PatchMapFile()
54 PATCH_LOGE("Failed to open file %s", fileName.c_str()); in PatchMapFile()
/base/notification/common_event_service/frameworks/common/test/unittest/common_event_log_test/
Devent_log_test.cpp68 std::string fileName = "../function/EventFwk/test.cpp"; variable
71 std::string result = EventLogWrapper::GetBriefFileName(fileName.c_str());
85 std::string fileName = "test.cpp"; variable
88 std::string result = EventLogWrapper::GetBriefFileName(fileName.c_str());
91 fileName = "";
92 result = EventLogWrapper::GetBriefFileName(fileName.c_str());
/base/hiviewdfx/hiview/plugins/eventlogger/log_catcher/
Devent_log_catcher.cpp65 int EventLogCatcher::AppendFile(int fd, const std::string &fileName) const in AppendFile()
70 HIVIEW_LOGW("parameter err, fd:%{public}d, filename:%{public}s.", fd, fileName.c_str()); in AppendFile()
75 if (realpath(fileName.c_str(), path) == nullptr) { in AppendFile()
76 std::string errStr = "canonicalize failed, file name is " + fileName + in AppendFile()
83 if (fileName != std::string(path)) { in AppendFile()
90 HIVIEW_LOGW("open %{public}s failed. errno is %{public}d", fileName.c_str(), errno); in AppendFile()
/base/startup/init/services/param/manager/
Dparam_server.c210 static int LoadSecurityLabel(const char *fileName) in LoadSecurityLabel() argument
215 PARAM_CHECK(fileName != NULL, return -1, "Invalid filename for load"); in LoadSecurityLabel()
220 ops->securityGetLabel(fileName); in LoadSecurityLabel()
253 static int LoadDefaultParam_(const char *fileName, uint32_t mode, in LoadDefaultParam_() argument
258 realpath(fileName, realPath); in LoadDefaultParam_()
261 PARAM_LOGE("Failed to open file '%s' error:%d ", fileName, errno); in LoadDefaultParam_()
278 PARAM_LOGV("Load %u default parameters success from %s.", paramNum, fileName); in LoadDefaultParam_()
282 static int ProcessParamFile(const char *fileName, void *context) in ProcessParamFile() argument
286 return LoadDefaultParam_(fileName, mode, exclude, ARRAY_LENGTH(exclude), LoadOneParam_); in ProcessParamFile()
289 int LoadParamsFile(const char *fileName, bool onlyAdd) in LoadParamsFile() argument
[all …]
/base/security/huks/test/unittest/huks_standard_test/module_test/utils_test/src/
Dhks_file_operator_test.cpp167 char *fileName = (char *)HksMalloc(fileNameSize); variable
168 (void)memset_s(fileName, fileNameSize, 1, fileNameSize);
169 int32_t ret = HksIsFileExist(path, fileName);
171 HksFree(fileName);
196 char *fileName = (char *)HksMalloc(fileNameSize); variable
197 (void)memset_s(fileName, fileNameSize, 1, fileNameSize);
198 int32_t ret = HksFileRemove(path, fileName);
200 HksFree(fileName);
/base/update/updater/services/package/pkg_package/
Dpkg_pkgfile.cpp42 PkgEntryPtr PkgFileImpl::AddPkgEntry(const std::string &fileName) in AddPkgEntry() argument
65 pkgEntryMapFileName_.insert(std::pair<std::string, PkgEntryPtr>(fileName, entry)); in AddPkgEntry()
86 PkgEntryPtr PkgFileImpl::FindPkgEntry(const std::string &fileName) in FindPkgEntry() argument
92 std::multimap<std::string, PkgEntryPtr>::iterator iter = pkgEntryMapFileName_.find(fileName); in FindPkgEntry()
112 int32_t PkgFileImpl::ConvertBufferToString(std::string &fileName, const PkgBuffer &buffer) in ConvertBufferToString() argument
118 fileName.push_back(buffer.buffer[i]); in ConvertBufferToString()
123 int32_t PkgFileImpl::ConvertStringToBuffer(const std::string &fileName, const PkgBuffer &buffer, si… in ConvertStringToBuffer() argument
125 if (buffer.length < fileName.size()) { in ConvertStringToBuffer()
129 for (uint32_t i = 0; i < fileName.size(); ++i) { in ConvertStringToBuffer()
130 buffer.buffer[i] = static_cast<uint8_t>(fileName[i]); in ConvertStringToBuffer()
/base/security/huks/services/huks_standard/huks_service/main/core/src/
Dhks_storage.c68 char *fileName; member
307 static HksStorageFileLock *CreateStorageFileLock(const char *path, const char *fileName) in CreateStorageFileLock() argument
312 int32_t ret = HksGetFileName(path, fileName, fullPath, HKS_MAX_FILE_NAME_LEN); in CreateStorageFileLock()
326 const char *path, const char *fileName, uint32_t offset, const uint8_t *buf, uint32_t len) in HksStorageWriteFile() argument
329 HksStorageFileLock *lock = CreateStorageFileLock(path, fileName); in HksStorageWriteFile()
331 int32_t ret = HksFileWrite(path, fileName, offset, buf, len); in HksStorageWriteFile()
336 return HksFileWrite(path, fileName, offset, buf, len); in HksStorageWriteFile()
341 const char *path, const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len) in HksStorageReadFile() argument
344 HksStorageFileLock *lock = CreateStorageFileLock(path, fileName); in HksStorageReadFile()
346 uint32_t size = HksFileRead(path, fileName, offset, buf, len); in HksStorageReadFile()
[all …]

12345678910