Home
last modified time | relevance | path

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

123456

/base/security/huks/interfaces/innerkits/huks_standard/test/unittest/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/src/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.c45 static int32_t GetFileName(const char *path, const char *fileName, char *fullFileName, uint32_t ful… in GetFileName() argument
58 if (strncat_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
62 if (strncpy_s(fullFileName, fullFileNameLen, fileName, strlen(fileName)) != EOK) { in GetFileName()
70 static int32_t GetFullFileName(const char *path, const char *fileName, char **fullFileName) in GetFullFileName() argument
79 int32_t ret = GetFileName(path, fileName, tmpFileName, nameLen); in GetFullFileName()
91 static int32_t IsFileExist(const char *fileName) in IsFileExist() argument
94 int32_t ret = stat(fileName, &fileStat); in IsFileExist()
107 static uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len) in FileRead() argument
110 int32_t fd = open(fileName, O_RDONLY); in FileRead()
126 static uint32_t FileSize(const char *fileName) in FileSize() argument
[all …]
Dhks_file_operator.h41 char fileName[HKS_MAX_DIRENT_FILE_LEN]; /* point to dirent->d_name */ member
53 uint32_t HksFileRead(const char *path, const char *fileName, uint32_t offset, uint8_t *buf, uint32_…
55 int32_t HksFileWrite(const char *path, const char *fileName, uint32_t offset, const uint8_t *buf, u…
57 int32_t HksFileRemove(const char *path, const char *fileName);
59 uint32_t HksFileSize(const char *path, const char *fileName);
61 int32_t HksIsFileExist(const char *path, const char *fileName);
78 int32_t HksOldVersionFileRead(const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len);
80 int32_t HksOldVersionFileRemove(const char *fileName);
83 int32_t HksOldVersionFileSize(const char *fileName);
86 bool HksOldVersionIsFileExist(const char *fileName);
[all …]
Dhks_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/user_iam/pin_auth/hdi/adaptor/src/
Dfile_operator.c21 static bool IsFileExist(const char *fileName) in IsFileExist() argument
23 if (fileName == NULL) { in IsFileExist()
27 FILE *fileOperator = fopen(fileName, "rb"); in IsFileExist()
35 static int32_t ReadFile(const char *fileName, uint8_t *buf, uint32_t len) in ReadFile() argument
37 if ((fileName == NULL) || (buf == NULL) || (len == 0) || (len > SIZE_MAX)) { in ReadFile()
41 FILE *fileOperator = fopen(fileName, "rb"); in ReadFile()
56 static int32_t WriteFile(const char *fileName, const uint8_t *buf, uint32_t len) in WriteFile() argument
58 if ((fileName == NULL) || (buf == NULL) || (len == 0) || (len > SIZE_MAX)) { in WriteFile()
62 FILE *fileOperator = fopen(fileName, "wb"); in WriteFile()
77 static int32_t GetFileLen(const char *fileName, uint32_t *len) in GetFileLen() argument
[all …]
/base/user_iam/auth_executor_mgr/common/adaptor/src/
Dfile_operator.c22 static bool IsFileExist(const char *fileName) in IsFileExist() argument
24 if (fileName == NULL) { in IsFileExist()
28 FILE *fileOperator = fopen(fileName, "rb"); in IsFileExist()
36 static int32_t ReadFile(const char *fileName, uint8_t *buf, uint32_t len) in ReadFile() argument
38 if ((fileName == NULL) || (buf == NULL) || (len == 0) || (len > SIZE_MAX)) { in ReadFile()
42 FILE *fileOperator = fopen(fileName, "rb"); in ReadFile()
58 static int32_t WriteFile(const char *fileName, const uint8_t *buf, uint32_t len) in WriteFile() argument
60 if ((fileName == NULL) || (buf == NULL) || (len == 0) || (len > SIZE_MAX)) { in WriteFile()
64 FILE *fileOperator = fopen(fileName, "wb"); in WriteFile()
79 static int32_t GetFileLen(const char *fileName, uint32_t *len) in GetFileLen() argument
[all …]
/base/account/os_account/frameworks/common/test/unittest/common_account_log_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);
/base/startup/init_lite/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) {
/base/security/huks/test/unittest/src/common/include/
Dhks_test_file_operator.h25 int32_t HksIsFileExist(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/user_iam/auth_executor_mgr/common/adaptor/inc/
Dadaptor_file.h27 bool (*isFileExist)(const char *fileName);
28 int32_t (*getFileLen)(const char *fileName, uint32_t *len);
29 int32_t (*readFile)(const char *fileName, uint8_t *buf, uint32_t len);
30 int32_t (*writeFile)(const char *fileName, const uint8_t *buf, uint32_t len);
31 int32_t (*deleteFile)(const char *fileName);
/base/user_iam/pin_auth/hdi/adaptor/inc/
Dadaptor_file.h27 bool (*isFileExist)(const char *fileName);
28 int32_t (*getFileLen)(const char *fileName, uint32_t *len);
29 int32_t (*readFile)(const char *fileName, uint8_t *buf, uint32_t len);
30 int32_t (*writeFile)(const char *fileName, const uint8_t *buf, uint32_t len);
31 int32_t (*deleteFile)(const char *fileName);
/base/notification/ces_standard/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/security/huks/interfaces/innerkits/huks_standard/test/unittest/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.cpp42 int32_t Store::FreeStore(const std::string &dirPath, const std::string &fileName) in FreeStore() argument
46 if (!fileName.empty()) { in FreeStore()
82 int32_t Store::WriteDataToStore(const std::string &dirPath, const std::string &fileName, in WriteDataToStore() argument
87 if (!fileName.empty()) { in WriteDataToStore()
90 std::string path = pathTmp + fileName; in WriteDataToStore()
91 pathTmp = pathTmp + fileName; in WriteDataToStore()
112 int32_t Store::LoadDataFromStore(const std::string &dirPath, const std::string &fileName, in LoadDataFromStore() argument
115 LOG(INFO) << "Store base is " << dirPath << "/" << fileName; in LoadDataFromStore()
117 if (!fileName.empty()) { in LoadDataFromStore()
118 path = path + "/" + fileName; in LoadDataFromStore()
/base/startup/init_lite/services/param/manager/
Dparam_utils.c31 void CheckAndCreateDir(const char *fileName) in CheckAndCreateDir() argument
33 if (fileName == NULL || *fileName == '\0') { in CheckAndCreateDir()
36 char *path = strndup(fileName, strrchr(fileName, '/') - fileName); in CheckAndCreateDir()
/base/hiviewdfx/faultloggerd/utils/
Ddirectory_ex.cpp49 string ExtractFileExt(const string& fileName) in ExtractFileExt() argument
51 string::size_type pos = fileName.rfind("."); in ExtractFileExt()
56 return string(fileName).substr(pos + 1, fileName.size()); in ExtractFileExt()
173 bool RemoveFile(const string& fileName) in RemoveFile() argument
175 if (access(fileName.c_str(), F_OK) == 0) { in RemoveFile()
176 return remove(fileName.c_str()) == 0; in RemoveFile()
205 bool ChangeMode(const string& fileName, const mode_t& mode) in ChangeMode() argument
207 return (chmod(fileName.c_str(), mode) == 0); in ChangeMode()
210 bool ChangeModeFile(const string& fileName, const mode_t& mode) in ChangeModeFile() argument
212 if (access(fileName.c_str(), F_OK) != 0) { in ChangeModeFile()
[all …]
/base/update/updater/services/package/pkg_manager/
Dpkg_utils.cpp40 std::string GetFilePath(const std::string &fileName) in GetFilePath() argument
42 int32_t pos = fileName.find_last_of('/'); in GetFilePath()
44 pos = fileName.find_last_of('\\'); in GetFilePath()
46 return fileName.substr(0, pos + 1); in GetFilePath()
49 size_t GetFileSize(const std::string &fileName) in GetFileSize() argument
51 char *realPath = realpath(fileName.c_str(), NULL); in GetFileSize()
55 PKG_CHECK(fp != nullptr, return 0, "Invalid file %s", fileName.c_str()); in GetFileSize()
69 int32_t CheckFile(const std::string &fileName) in CheckFile() argument
73 std::string path = GetFilePath(fileName); in CheckFile()
82 PKG_CHECK(ret != -1, return PKG_NONE_PERMISSION, "file %s no permission ", fileName.c_str()); in CheckFile()
[all …]
/base/update/updater/services/diffpatch/
Ddiffpatch.cpp26 int32_t WriteDataToFile(const std::string &fileName, const std::vector<uint8_t> &data, size_t dataS… in WriteDataToFile() argument
28 std::ofstream patchFile(fileName, std::ios::out | std::ios::binary); in WriteDataToFile()
29 PATCH_CHECK(patchFile, return -1, "Failed to open %s", fileName.c_str()); in WriteDataToFile()
35 int32_t PatchMapFile(const std::string &fileName, MemMapInfo &info) in PatchMapFile() argument
37 int32_t file = open(fileName.c_str(), O_RDONLY); in PatchMapFile()
38 PATCH_CHECK(file >= 0, return -1, "Failed to open file %s", fileName.c_str()); in PatchMapFile()
/base/update/updater/services/package/pkg_package/
Dpkg_pkgfile.cpp41 PkgEntryPtr PkgFile::AddPkgEntry(const std::string &fileName) in AddPkgEntry() argument
64 pkgEntryMapFileName_.insert(std::pair<std::string, PkgEntryPtr>(fileName, entry)); in AddPkgEntry()
78 PkgEntryPtr PkgFile::FindPkgEntry(const std::string &fileName) in FindPkgEntry() argument
82 std::multimap<std::string, PkgEntryPtr>::iterator iter = pkgEntryMapFileName_.find(fileName); in FindPkgEntry()
102 int32_t PkgFile::ConvertBufferToString(std::string &fileName, const PkgBuffer &buffer) in ConvertBufferToString() argument
108 fileName.push_back(buffer.buffer[i]); in ConvertBufferToString()
113 int32_t PkgFile::ConvertStringToBuffer(const std::string &fileName, const PkgBuffer &buffer, size_t… in ConvertStringToBuffer() argument
115 PKG_CHECK(buffer.length >= fileName.size(), return PKG_INVALID_PARAM, "Invalid buffer"); in ConvertStringToBuffer()
116 for (uint32_t i = 0; i < fileName.size(); ++i) { in ConvertStringToBuffer()
117 buffer.buffer[i] = static_cast<uint8_t>(fileName[i]); in ConvertStringToBuffer()
/base/security/huks/services/huks_standard/huks_service/main/core/src/
Dhks_storage.c51 char *fileName; member
279 static HksStorageFileLock *CreateStorageFileLock(const char *path, const char *fileName) in CreateStorageFileLock() argument
286 int32_t ret = HksGetFileName(path, fileName, fullPath, HKS_MAX_FILE_NAME_LEN); in CreateStorageFileLock()
300 const char *path, const char *fileName, uint32_t offset, const uint8_t *buf, uint32_t len) in HksStorageWriteFile() argument
303 HksStorageFileLock *lock = CreateStorageFileLock(path, fileName); in HksStorageWriteFile()
305 int32_t ret = HksFileWrite(path, fileName, offset, buf, len); in HksStorageWriteFile()
310 return HksFileWrite(path, fileName, offset, buf, len); in HksStorageWriteFile()
315 const char *path, const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len) in HksStorageReadFile() argument
318 HksStorageFileLock *lock = CreateStorageFileLock(path, fileName); in HksStorageReadFile()
320 uint32_t size = HksFileRead(path, fileName, offset, buf, len); in HksStorageReadFile()
[all …]
/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()
80 if (fileName != std::string(path)) { in AppendFile()
87 HIVIEW_LOGW("open %{public}s failed.", fileName.c_str()); in AppendFile()
/base/startup/init_lite/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()
85 int ret = SetFileEnv(fd, tmpFile->fileName); in CreateServiceFile()
/base/startup/init_lite/services/param/adapter/
Dparam_selinux.c66 static int LoadParamLabels(const char *fileName, SecurityLabelFunc label, void *context) in LoadParamLabels() argument
68 FILE *fp = fopen(fileName, "r"); in LoadParamLabels()
69 PARAM_CHECK(fp != NULL, return -1, "Open file %s fail", fileName); in LoadParamLabels()
94 PARAM_LOGI("Load parameter info %d success %s", infoCount, fileName); in LoadParamLabels()
98 static int ProcessParamFile(const char *fileName, void *context) in ProcessParamFile() argument
101 return LoadParamLabels(fileName, cxt->label, cxt->context); in ProcessParamFile()
118 static int CheckFilePermission(const ParamSecurityLabel *localLabel, const char *fileName, int flag… in CheckFilePermission() argument
121 PARAM_CHECK(localLabel != NULL && fileName != NULL, return -1, "Invalid param"); in CheckFilePermission()
/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()
78 void MmsContentParam::SetFileName(std::string fileName) in SetFileName() argument
80 if (fileName.empty()) { in SetFileName()
84 textMap_.insert(std::make_pair(fieldCode, fileName)); in SetFileName()

123456