/foundation/bundlemanager/bundle_framework/interfaces/kits/js/zip/src/ |
H A D | file_path.cpp | 127 FilePath newPath(path_); in DirName() 128 newPath.StripTrailingSeparatorsInternal(); in DirName() 131 newPath.path_.find_last_of(kSeparators, std::string::npos, kSeparatorsLength - 1); in DirName() 138 newPath.path_.resize(zero); in DirName() 141 newPath.path_.resize(one); in DirName() 142 } else if (lastSeparator == one && IsSeparator(newPath.path_[zero])) { in DirName() 145 newPath.path_.resize(two); in DirName() 148 newPath.path_.resize(lastSeparator); in DirName() 151 newPath.StripTrailingSeparatorsInternal(); in DirName() 152 if (!newPath in DirName() [all...] |
/foundation/filemanagement/file_api/interfaces/kits/js/src/mod_fileio/properties/ |
H A D | symlink.cpp | 55 auto [resGetSymlinkArg, oldPath, newPath] = GetSymlinkArg(env, funcArg); in Sync() 60 if (symlink(oldPath.c_str(), newPath.c_str()) == -1) { in Sync() 76 auto [resGetSymlinkArg, oldPath, newPath] = GetSymlinkArg(env, funcArg); in Async() 81 auto cbExec = [oldPath = move(oldPath), newPath = move(newPath)](napi_env env) -> UniError { in Async() 82 int ret = symlink(oldPath.c_str(), newPath.c_str()); in Async()
|
H A D | link.cpp | 56 auto [resGetLinkArg, oldPath, newPath] = GetLinkArg(env, funcArg); in Sync() 61 if (link(oldPath.c_str(), newPath.c_str()) == -1) { in Sync() 77 auto [resGetLinkArg, oldPath, newPath] = GetLinkArg(env, funcArg); in Async() 82 auto cbExec = [oldPath = move(oldPath), newPath = move(newPath)](napi_env env) -> UniError { in Async() 83 int ret = link(oldPath.c_str(), newPath.c_str()); in Async()
|
/foundation/filemanagement/file_api/interfaces/kits/js/src/mod_fs/properties/ |
H A D | symlink.cpp | 56 auto [resGetSymlinkArg, oldPath, newPath] = GetSymlinkArg(env, funcArg);
in Sync() 70 int ret = uv_fs_symlink(nullptr, symlink_req.get(), oldPath.c_str(), newPath.c_str(), 0, nullptr);
in Sync() 89 auto [resGetSymlinkArg, oldPath, newPath] = GetSymlinkArg(env, funcArg);
in Async() 96 auto cbExec = [oldPath = move(oldPath), newPath = move(newPath)]() -> NError {
in Async() 103 int ret = uv_fs_symlink(nullptr, symlink_req.get(), oldPath.c_str(), newPath.c_str(), 0, nullptr);
in Async()
|
/foundation/filemanagement/app_file_service/utils/src/b_filesystem/ |
H A D | b_file.cpp | 121 string newPath(resolvedPath.get()); in CopyFile() 126 newPath.append("/").append(basename(name.get())); in CopyFile() 127 UniqueFd fdTo(open(newPath.data(), O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)); in CopyFile() 180 std::string newPath = ""; in MoveFile() local 181 if (!GetRealPath(dirname(dir.get()), newPath)) { in MoveFile() 188 newPath.append("/").append(basename(name.get())); in MoveFile() 189 if (rename(oldPath.c_str(), newPath.c_str()) != 0) { in MoveFile() 196 UniqueFd fdTo(open(newPath.data(), O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)); in MoveFile()
|
H A D | b_dir.cpp | 98 string newPath = path; in GetDirFilesDetail() local 100 newPath += BConstants::FILE_SEPARATOR_CHAR; in GetDirFilesDetail() 102 smallFiles.insert(make_pair(newPath, 0)); in GetDirFilesDetail() 337 string newPath = path; in GetUser0DirFilesDetail() local 339 newPath += BConstants::FILE_SEPARATOR_CHAR; in GetUser0DirFilesDetail() 341 smallFiles.push_back(newPath); in GetUser0DirFilesDetail()
|
/foundation/multimedia/media_library/frameworks/innerkitsimpl/test/unittest/medialibrary_helper_test/src/ |
H A D | media_file_utils_test.cpp | 109 string newPath = "/data/test/movefile_001_move"; in HWTEST_F() local 111 EXPECT_EQ(MediaFileUtils::MoveFile(oldPath, newPath), true); in HWTEST_F() 117 string newPath = "/data/test/movefile_002_move"; in HWTEST_F() local 119 EXPECT_EQ(MediaFileUtils::CreateFile(newPath), true); in HWTEST_F() 120 EXPECT_EQ(MediaFileUtils::MoveFile(oldPath, newPath), false); in HWTEST_F() 126 string newPath = "/data/test/movefile_003_move"; in HWTEST_F() local 127 EXPECT_EQ(MediaFileUtils::MoveFile(oldPath, newPath), false); in HWTEST_F() 168 string newPath = "/data/test/CopyByFd_002"; in HWTEST_F() local 172 EXPECT_EQ(MediaFileUtils::CreateFile(newPath), true); in HWTEST_F() 176 int32_t wfd = open(newPath in HWTEST_F() 186 string newPath = "/data/test/renamedir_001_renamed"; HWTEST_F() local 194 string newPath = ""; HWTEST_F() local 548 string newPath; HWTEST_F() local 571 string newPath = "datashare://test/Download"; HWTEST_F() local [all...] |
/foundation/filemanagement/storage_service/services/storage_daemon/mtpfs/src/ |
H A D | mtpfs_mtp_device.cpp | 331 int MtpFsDevice::DirReName(const std::string &oldPath, const std::string &newPath) in DirReName() argument 335 const std::string tmpNewBaseName(SmtpfsBaseName(newPath)); in DirReName() 336 const std::string tmpNewDirName(SmtpfsDirName(newPath)); in DirReName() 344 LOGE("Can not move %{public}s to %{public}s", oldPath.c_str(), newPath.c_str()); in DirReName() 365 int MtpFsDevice::ReNameInner(const std::string &oldPath, const std::string &newPath) in ReNameInner() argument 369 const std::string tmpNewBaseName(SmtpfsBaseName(newPath)); in ReNameInner() 370 const std::string tmpNewDirName(SmtpfsDirName(newPath)); in ReNameInner() 399 LOGE("Could not move %{public}s to %{public}s", oldPath.c_str(), newPath.c_str()); in ReNameInner() 412 LOGE("Could not rename %{public}s to %{public}s", oldPath.c_str(), newPath.c_str()); in ReNameInner() 421 int MtpFsDevice::ReName(const std::string &oldPath, const std::string &newPath) in ReName() argument 615 FileRename(const std::string &oldPath, const std::string &newPath) FileRename() argument [all...] |
/foundation/filemanagement/dfs_service/services/distributedfiledaemon/src/network/softbus/ |
H A D | softbus_asset_recv_listener.cpp | 184 std::string newPath = oldPath; in MoveAsset() local 185 size_t pos = newPath.find(TEMP_DIR); in MoveAsset() 190 newPath.replace(pos, TEMP_DIR.length(), ""); in MoveAsset() 191 pos = newPath.find(ASSET_FLAG_SINGLE); in MoveAsset() 196 newPath.resize(pos); in MoveAsset() 198 SoftBusHandlerAsset::GetInstance().MkDirRecurse(newPath, S_IRWXU | S_IRWXG | S_IXOTH); in MoveAsset() 199 std::filesystem::rename(oldPath.c_str(), newPath.c_str()); in MoveAsset() 208 std::string newPath = oldPath; in MoveAsset() local 209 size_t pos = newPath.find(TEMP_DIR); in MoveAsset() 214 newPath in MoveAsset() [all...] |
/foundation/filemanagement/storage_service/services/storage_daemon/mtpfs/include/ |
H A D | mtpfs_mtp_device.h | 78 int DirReName(const std::string &oldPath, const std::string &newPath); 81 int ReName(const std::string &oldPath, const std::string &newPath); 88 int FileRename(const std::string &oldPath, const std::string &newPath); 107 int ReNameInner(const std::string &oldPath, const std::string &newPath);
|
/foundation/multimedia/ringtone_library/test/unittest/ringtone_utils_test/src/ |
H A D | ringtone_file_utils_test.cpp | 217 string newPath = "/data/local/tmp/test/movefile_001_move.ogg"; in HWTEST_F() local 219 EXPECT_EQ(RingtoneFileUtils::MoveFile(oldPath, newPath), true); in HWTEST_F() 225 string newPath = "/data/local/tmp/test/movefile_001_move.ogg"; in HWTEST_F() local 227 EXPECT_EQ(RingtoneFileUtils::CopyFileUtil(oldPath, newPath), true); in HWTEST_F() 229 RingtoneFileUtils::CopyFileUtil(filePath, newPath); in HWTEST_F()
|
/foundation/bundlemanager/bundle_framework/services/bundlemgr/test/mock/src/ |
H A D | installd_client.cpp | 89 ErrCode InstalldClient::RenameModuleDir(const std::string &oldPath, const std::string &newPath) in RenameModuleDir() argument 91 if (oldPath.empty() || newPath.empty()) { in RenameModuleDir() 96 return CallService(&IInstalld::RenameModuleDir, oldPath, newPath); in RenameModuleDir() 251 ErrCode InstalldClient::MoveFile(const std::string &oldPath, const std::string &newPath) in MoveFile() argument 253 if (oldPath.empty() || newPath.empty()) { in MoveFile() 258 return CallService(&IInstalld::MoveFile, oldPath, newPath); in MoveFile() 261 ErrCode InstalldClient::CopyFile(const std::string &oldPath, const std::string &newPath, in CopyFile() argument 264 if (oldPath.empty() || newPath.empty()) { in CopyFile() 269 return CallService(&IInstalld::CopyFile, oldPath, newPath, signatureFilePath); in CopyFile()
|
H A D | mock_installd_host_impl.cpp | 59 ErrCode InstalldHostImpl::RenameModuleDir(const std::string &oldPath, const std::string &newPath)
in RenameModuleDir() argument 140 ErrCode InstalldHostImpl::MoveFile(const std::string &oldPath, const std::string &newPath)
in MoveFile() argument 145 ErrCode InstalldHostImpl::CopyFile(const std::string &oldPath, const std::string &newPath,
in CopyFile() argument
|
/foundation/bundlemanager/bundle_framework/services/bundlemgr/src/ |
H A D | installd_client.cpp | 95 ErrCode InstalldClient::RenameModuleDir(const std::string &oldPath, const std::string &newPath) in RenameModuleDir() argument 97 if (oldPath.empty() || newPath.empty()) { in RenameModuleDir() 102 return CallService(&IInstalld::RenameModuleDir, oldPath, newPath); in RenameModuleDir() 309 ErrCode InstalldClient::MoveFile(const std::string &oldPath, const std::string &newPath) in MoveFile() argument 311 if (oldPath.empty() || newPath.empty()) { in MoveFile() 316 return CallService(&IInstalld::MoveFile, oldPath, newPath); in MoveFile() 319 ErrCode InstalldClient::CopyFile(const std::string &oldPath, const std::string &newPath, in CopyFile() argument 322 if (oldPath.empty() || newPath.empty()) { in CopyFile() 327 return CallService(&IInstalld::CopyFile, oldPath, newPath, signatureFilePath); in CopyFile()
|
/foundation/distributeddatamgr/relational_store/frameworks/native/rdb/src/ |
H A D | connection_pool.cpp | 360 int ConnPool::ChangeDbFileForRestore(const std::string &newPath, const std::string &backupPath, in ChangeDbFileForRestore() argument 363 if (!writers_.IsFull() || config_.GetPath() == backupPath || newPath == backupPath) { in ChangeDbFileForRestore() 384 return RestoreByDbSqliteType(newPath, backupPath, slaveStatus); in ChangeDbFileForRestore() 387 int ConnPool::RestoreByDbSqliteType(const std::string &newPath, const std::string &backupPath, SlaveStatus &slaveStatus) in RestoreByDbSqliteType() argument 397 return RestoreMasterDb(newPath, backupPath); in RestoreByDbSqliteType() 400 int ConnPool::RestoreMasterDb(const std::string &newPath, const std::string &backupPath) in RestoreMasterDb() argument 412 if (config_.GetPath() != newPath) { in RestoreMasterDb() 413 RdbStoreConfig config(newPath); in RestoreMasterDb() 414 config.SetPath(newPath); in RestoreMasterDb() 419 if (!SqliteUtils::CopyFile(backupPath, newPath)) { in RestoreMasterDb() [all...] |
/foundation/multimedia/ringtone_library/services/utils/include/ |
H A D | ringtone_file_utils.h | 65 EXPORT static bool MoveFile(const std::string &oldPath, const std::string &newPath); 66 EXPORT static bool CopyFileUtil(const std::string &filePath, const std::string &newPath);
|
/foundation/distributeddatamgr/relational_store/frameworks/native/rdb/include/ |
H A D | connection_pool.h | 57 int ChangeDbFileForRestore(const std::string &newPath, const std::string &backupPath,
126 int RestoreByDbSqliteType(const std::string &newPath, const std::string &backupPath, SlaveStatus &slaveStatus);
127 int RestoreMasterDb(const std::string &newPath, const std::string &backupPath);
|
/foundation/ability/idl_tool/idl_tool_2/util/ |
H A D | file.cpp | 246 std::string newPath = StringHelper::Replace(path, '\\', '/'); in CreatePartDir() local 248 std::string newPath = StringHelper::Replace(path, '/', '\\'); in CreatePartDir() 254 for (size_t i = 0; i < newPath.size(); i++) { in CreatePartDir() 255 char c = newPath[i]; in CreatePartDir()
|
/foundation/bundlemanager/bundle_framework/services/bundlemgr/test/unittest/bms_installd_client_test/ |
H A D | bms_installd_client_test.cpp | 38 const std::string NEW_PATH = "newPath"; 311 std::string newPath = NEW_PATH; in HWTEST_F() local 312 ErrCode result = installClient_->RenameModuleDir(oldPath, newPath); in HWTEST_F() 320 * @tc.desc: Test whether RenameModuleDir is called normally.(newPath is empty) 326 std::string newPath = EMPTY_STRING; in HWTEST_F() local 327 ErrCode result = installClient_->RenameModuleDir(oldPath, newPath); in HWTEST_F() 341 std::string newPath = NEW_PATH; in HWTEST_F() local 342 ErrCode result = installClient_->RenameModuleDir(oldPath, newPath); in HWTEST_F() 343 EXPECT_EQ(result, installClient_->CallService(&IInstalld::RenameModuleDir, oldPath, newPath)); in HWTEST_F() 772 std::string newPath in HWTEST_F() local 787 std::string newPath = EMPTY_STRING; HWTEST_F() local 802 std::string newPath = NEW_PATH; HWTEST_F() local 817 std::string newPath = NEW_PATH; HWTEST_F() local 832 std::string newPath = EMPTY_STRING; HWTEST_F() local 847 std::string newPath = NEW_PATH; HWTEST_F() local [all...] |
/foundation/multimedia/media_library/frameworks/innerkitsimpl/media_library_helper/src/ |
H A D | media_file_utils.cpp | 557 bool MediaFileUtils::MoveFile(const string &oldPath, const string &newPath) in MoveFile() argument 561 if (IsFileExists(oldPath) && !IsFileExists(newPath)) { in MoveFile() 562 errRet = (rename(oldPath.c_str(), newPath.c_str()) == E_SUCCESS); in MoveFile() 568 bool MediaFileUtils::CopyFileUtil(const string &filePath, const string &newPath) in CopyFileUtil() argument 594 int32_t dest = open(newPath.c_str(), O_WRONLY | O_CREAT, CHOWN_RO_USR_GRP); in CopyFileUtil() 774 bool MediaFileUtils::RenameDir(const string &oldPath, const string &newPath) in RenameDir() argument 779 errRet = (rename(oldPath.c_str(), newPath.c_str()) == E_SUCCESS); in RenameDir() 1254 int32_t MediaFileUtils::ModifyAsset(const string &oldPath, const string &newPath) argument 1258 if (oldPath.empty() || newPath.empty()) { 1259 MEDIA_ERR_LOG("Failed to modify asset, oldPath: %{private}s or newPath [all...] |
/foundation/multimedia/media_library/frameworks/services/media_backup_extension/src/ |
H A D | backup_file_utils.cpp | 320 int32_t BackupFileUtils::MoveFile(const string &oldPath, const string &newPath, int32_t sceneCode) in MoveFile() argument 326 } else if (MediaFileUtils::IsFileExists(newPath)) { in MoveFile() 327 MEDIA_ERR_LOG("new path: %{public}s is exists.", GarbleFilePath(newPath, sceneCode).c_str()); in MoveFile() 330 return rename(oldPath.c_str(), newPath.c_str()); in MoveFile() 577 static void addPathSuffix(const string &oldPath, const string &suffix, string &newPath) in addPathSuffix() argument 584 newPath = oldPath + suffix; in addPathSuffix() 585 while (MediaFileUtils::IsFileExists(newPath)) { in addPathSuffix() 586 newPath += ".dup" + suffix; in addPathSuffix()
|
/foundation/arkui/ace_engine/frameworks/core/components/common/properties/ |
H A D | animatable_path.h | 60 AnimatablePath& operator=(const AnimatablePath& newPath);
|
/foundation/bundlemanager/bundle_framework/services/bundlemgr/include/installd/ |
H A D | installd_host_impl.h | 75 * @param newPath Indicates the new path name. 78 virtual ErrCode RenameModuleDir(const std::string &oldPath, const std::string &newPath) override; 166 virtual ErrCode MoveFile(const std::string &oldPath, const std::string &newPath) override; 168 virtual ErrCode CopyFile(const std::string &oldPath, const std::string &newPath,
|
/foundation/bundlemanager/bundle_framework/services/bundlemgr/include/ |
H A D | installd_client.h | 56 * @param newPath Indicates the new path name. 59 ErrCode RenameModuleDir(const std::string &oldPath, const std::string &newPath); 152 ErrCode MoveFile(const std::string &oldPath, const std::string &newPath); 154 ErrCode CopyFile(const std::string &oldPath, const std::string &newPath,
|
/foundation/bundlemanager/bundle_framework/services/bundlemgr/include/ipc/ |
H A D | installd_proxy.h | 77 * @param newPath Indicates the new path name. 80 virtual ErrCode RenameModuleDir(const std::string &oldPath, const std::string &newPath) override; 167 virtual ErrCode MoveFile(const std::string &oldPath, const std::string &newPath) override; 169 virtual ErrCode CopyFile(const std::string &oldPath, const std::string &newPath,
|