/ohos5.0/foundation/bundlemanager/bundle_framework/interfaces/kits/js/zip/src/ |
H A D | zip.cpp | 112 ZipParams::ZipParams(const std::vector<FilePath>& srcDir, const FilePath& destFile) in ZipParams() argument 113 : srcDir_(srcDir), destFile_(destFile) in ZipParams() 320 bool Unzip(const std::string &srcFile, const std::string &destFile, OPTIONS options, in Unzip() argument 328 FilePath destDir(destFile); in Unzip() 329 if ((destDir.Value().size() == 0) || FilePath::HasRelativePathBaseOnAPIVersion(destFile)) { in Unzip() 368 ErrCode ZipWithFilterCallback(const FilePath &srcDir, const FilePath &destFile, in ZipWithFilterCallback() argument 371 FilePath destPath = destFile; in ZipWithFilterCallback() 405 FilePath destPath = destFile; in ZipsWithFilterCallback() 444 FilePath destFile(destPath); in Zip() local 456 auto innerTask = [srcDir, destFile, includeHiddenFiles, zlibCallbackInfo, options]() { in Zip() [all …]
|
/ohos5.0/foundation/communication/dsoftbus/sdk/transmission/trans_channel/proxy/src/ |
H A D | client_trans_proxy_file_common.c | 77 bool CheckDestFilePathValid(const char *destFile) in CheckDestFilePathValid() argument 79 if (destFile == NULL) { in CheckDestFilePathValid() 83 int32_t len = (int32_t)(strlen(destFile)); in CheckDestFilePathValid() 89 if (strstr(destFile, "..") != NULL) { in CheckDestFilePathValid() 195 int32_t FileListToBuffer(const char **destFile, uint32_t fileCnt, FileListBuffer *outbufferInfo) in FileListToBuffer() argument 197 if (destFile == NULL || outbufferInfo == NULL || fileCnt == 0) { in FileListToBuffer() 205 size_t fileNameLength = strlen(destFile[i]); in FileListToBuffer() 222 uint32_t fileNameSize = strlen(destFile[index]); in FileListToBuffer() 229 … if (memcpy_s(fileItem->fileName, bufferSize - offset, destFile[index], fileNameSize) != EOK) { in FileListToBuffer()
|
H A D | client_trans_proxy_file_manager.c | 254 if (info == NULL || fileFrame == NULL || destFile == NULL) { in PackFileTransStartInfo() 258 uint32_t len = strlen(destFile); in PackFileTransStartInfo() 282 if (memcpy_s(fileFrame->fileData + FRAME_DATA_SEQ_OFFSET, len, destFile, len) != EOK) { in PackFileTransStartInfo() 667 if (!CheckDestFilePathValid(destFile)) { in FileToFrameAndSendFile() 689 sendInfo->channelId, sourceFile, absSrcPath, destFile, fileSize, frameNum); in FileToFrameAndSendFile() 705 int32_t ret = FileToFrame(sendInfo, frameNum, destFile, fileSize); in FileToFrameAndSendFile() 729 if ((sourceFile == NULL) || (destFile == NULL)) { in SendSingleFile() 734 sourceFile, destFile); in SendSingleFile() 736 int32_t ret = FileToFrameAndSendFile((SendListenerInfo *)sendInfo, sourceFile, destFile); in SendSingleFile() 743 static int32_t SendFileList(int32_t channelId, const char **destFile, uint32_t fileCnt) in SendFileList() argument [all …]
|
/ohos5.0/foundation/filemanagement/file_api/interfaces/kits/cj/src/ |
H A D | copy_file.cpp | 67 static int IsAllPath(FileInfo& srcFile, FileInfo& destFile) in IsAllPath() argument 71 filesystem::path dstPath(string(destFile.path.get())); in IsAllPath() 86 int ret = uv_fs_copyfile(nullptr, copyfile_req.get(), srcFile.path.get(), destFile.path.get(), in IsAllPath() 164 static int OpenFile(FileInfo& srcFile, FileInfo& destFile) in OpenFile() argument 177 if (destFile.isPath) { in OpenFile() 178 auto openResult = OpenCore(destFile, UV_FS_O_RDWR | UV_FS_O_CREAT | in OpenFile() 184 auto truncateResult = TruncateCore(destFile); in OpenFile() 188 auto ret = lseek(destFile.fdg->GetFD(), 0, SEEK_SET); in OpenFile() 194 return SendFileCore(srcFile, destFile, statbf); in OpenFile()
|
/ohos5.0/foundation/filemanagement/file_api/interfaces/kits/js/src/mod_fs/properties/ |
H A D | copy_file.cpp | 36 static NError IsAllPath(FileInfo& srcFile, FileInfo& destFile) in IsAllPath() argument 40 filesystem::path dstPath(string(destFile.path.get())); in IsAllPath() 53 int ret = uv_fs_copyfile(nullptr, copyfile_req.get(), srcFile.path.get(), destFile.path.get(), in IsAllPath() 137 static NError OpenFile(FileInfo& srcFile, FileInfo& destFile) in OpenFile() argument 150 if (destFile.isPath) { in OpenFile() 151 auto openResult = OpenCore(destFile, UV_FS_O_RDWR | UV_FS_O_CREAT | in OpenFile() 157 auto truncateResult = TruncateCore(destFile); in OpenFile() 161 auto ret = lseek(destFile.fdg->GetFD(), 0, SEEK_SET); in OpenFile() 170 return SendFileCore(srcFile, destFile, statbf); in OpenFile()
|
/ohos5.0/foundation/filemanagement/file_api/interfaces/kits/js/src/mod_fileio/properties/ |
H A D | copy_file.cpp | 46 static UniError CopyFileCore(FileInfo &srcFile, FileInfo &destFile) in CopyFileCore() argument 61 if (destFile.isPath) { in CopyFileCore() 62 int ret = open(destFile.path.get(), O_WRONLY | O_CREAT, statbf.st_mode); in CopyFileCore() 66 destFile.fdg.SetFD(ret, true); in CopyFileCore() 77 ssize_t writeSize = write(destFile.fdg.GetFD(), copyBuf.get(), readSize); in CopyFileCore()
|
/ohos5.0/foundation/filemanagement/user_file_service/interfaces/kits/native/trash/src/ |
H A D | file_trash_n_exporter.cpp | 253 auto [isExist, ret] = Access(destFile); in GenerateNewFileName() 255 destFile = filePathName + to_string(index++) + fileSuffix; in GenerateNewFileName() 256 return GenerateNewFileName(destFile, filePathName, index, fileSuffix); in GenerateNewFileName() 279 static int MoveFile(const string &srcFile, const string &destFile) in MoveFile() argument 282 auto [isExist, ret] = Access(destFile); in MoveFile() 286 size_t slashPos = destFile.find_last_of("/"); in MoveFile() 292 size_t suffixPos = destFile.find_last_of('.'); in MoveFile() 297 filePathName = destFile + filePathName; in MoveFile() 299 filePathName = destFile.substr(0, suffixPos) + filePathName; in MoveFile() 300 fileSuffix = destFile.substr(suffixPos); in MoveFile() [all …]
|
/ohos5.0/foundation/distributeddatamgr/relational_store/frameworks/native/rdb/src/ |
H A D | sqlite_utils.cpp | 133 bool SqliteUtils::RenameFile(const std::string &srcFile, const std::string &destFile) in RenameFile() argument 135 auto ret = rename(srcFile.c_str(), destFile.c_str()); in RenameFile() 138 SqliteUtils::Anonymous(destFile).c_str(), srcFile.c_str()); in RenameFile() 144 bool SqliteUtils::CopyFile(const std::string &srcFile, const std::string &destFile) in CopyFile() argument 151 std::ofstream dst(destFile.c_str(), std::ios::binary); in CopyFile() 154 …pen destFile failed errno %{public}d %{public}s", errno, SqliteUtils::Anonymous(destFile).c_str()); in CopyFile()
|
/ohos5.0/docs/zh-cn/application-dev/file-management/ |
H A D | app-file-access.md | 98 …let destFile = fs.openSync(filesDir + '/destFile.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE… 113 fs.writeSync(destFile.fd, buf, writeOptions); 119 fs.closeSync(destFile); 129 以下示例代码演示了如何使用流接口读取test.txt的文件内容并写入到destFile.txt文件中。 144 let outputStream = fs.createStreamSync(filesDir + '/destFile.txt', "w+");
|
/ohos5.0/foundation/bundlemanager/bundle_framework/test/fuzztest/fuzztest_others/copyfiles_fuzzer/ |
H A D | copyfiles_fuzzer.cpp | 33 std::string destFile (reinterpret_cast<const char*>(data), size); in DoSomethingInterestingWithMyAPI() 34 destFiles.push_back(destFile); in DoSomethingInterestingWithMyAPI()
|
/ohos5.0/foundation/bundlemanager/bundle_framework/interfaces/kits/js/zip/test/unittest/ |
H A D | zip_test.cpp | 175 FilePath destFile(dest); 180 destFile.CheckDestDirTail(); 181 FilePath newDestFile(destFile.CheckDestDirTail()); 291 FilePath destFile(dest); 297 destFile.CheckDestDirTail(); 298 FilePath newDestFile(destFile.CheckDestDirTail());
|
/ohos5.0/foundation/communication/dsoftbus/tests/sdk/transmission/fuzztest/clienttransproxyfilecommon_fuzzer/ |
H A D | clienttransproxyfilecommon_fuzzer.cpp | 44 char *destFile = nullptr; in ClientTransProxyFileCommonTest() local 58 CheckDestFilePathValid(destFile); in ClientTransProxyFileCommonTest()
|
/ohos5.0/foundation/communication/dsoftbus/sdk/transmission/trans_channel/proxy/include/ |
H A D | client_trans_proxy_file_common.h | 49 bool CheckDestFilePathValid(const char *destFile); 53 int32_t FileListToBuffer(const char **destFile, uint32_t fileCnt, FileListBuffer *outbufferInfo);
|
/ohos5.0/base/hiviewdfx/hiview/base/running_status_logger/ |
H A D | running_status_logger.cpp | 41 std::string destFile = this->GetLogWroteDestFile(logInfo); in Log() local 42 … HIVIEW_LOGD("writing \"%{public}s\" into %{public}s.", logInfo.c_str(), destFile.c_str()); in Log() 43 if (!FileUtil::SaveStringToFile(destFile, logInfo + "\n", false)) { in Log()
|
/ohos5.0/foundation/bundlemanager/bundle_framework/test/fuzztest/fuzztest_others/zip_fuzzer/ |
H A D | zip_fuzzer.cpp | 44 std::string destFile = ""; in DoSomethingInterestingWithMyAPI() local 45 Unzip(srcFile, destFile, options, zlibCallbackInfo); in DoSomethingInterestingWithMyAPI()
|
/ohos5.0/base/hiviewdfx/hiview/base/utility/ |
H A D | hiview_config_util.cpp | 91 std::string destFile = destDir + configFileName; in UnZipConfigFile() local 92 if (FileUtil::CopyFile(srcFile, destFile) != 0) { in UnZipConfigFile() 93 … HIVIEW_LOGE("failed to copy %{public}s to %{public}s", srcFile.c_str(), destFile.c_str()); in UnZipConfigFile()
|
/ohos5.0/foundation/multimedia/media_library/frameworks/innerkitsimpl/media_library_helper/src/ |
H A D | media_file_utils.cpp | 438 bool MediaFileUtils::CopyFileAndDelSrc(const std::string &srcFile, const std::string &destFile) in CopyFileAndDelSrc() argument 440 if (IsFileExists(destFile)) { in CopyFileAndDelSrc() 441 MEDIA_INFO_LOG("destFile:%{private}s already exists", destFile.c_str()); in CopyFileAndDelSrc() 442 if (!DeleteFile(destFile)) { in CopyFileAndDelSrc() 443 MEDIA_ERR_LOG("delete destFile:%{private}s error", destFile.c_str()); in CopyFileAndDelSrc() 446 if (!CreateFile(destFile)) { in CopyFileAndDelSrc() 447 MEDIA_ERR_LOG("create destFile:%{private}s failed", destFile.c_str()); in CopyFileAndDelSrc() 450 if (CopyFileUtil(srcFile, destFile)) { in CopyFileAndDelSrc() 456 bool delDestFileRet = DeleteFile(destFile); in CopyFileAndDelSrc()
|
/ohos5.0/docs/zh-cn/application-dev/reference/apis-core-file-kit/ |
H A D | js-apis-fileAccess-sys.md | 1082 move(sourceFile: string, destFile: string) : Promise<string> 1095 | destFile | string | 是 | 目标文件夹的uri | 1113 // 示例代码sourceFile destFile表示Download目录下文件和文件夹,该uri是对应的fileInfo中uri 1121 let fileUri = await fileAccessHelper.move(sourceFile, destFile); 1146 | destFile | string | 是 | 目标文件夹的uri | 1158 // 示例代码sourceFile destFile表示Download目录下文件和文件夹,该uri是对应的fileInfo中uri 1680 let copyResult = await fileAccessHelper.copy(sourceFile, destFile); 1758 let destFile: string = "file://docs/storage/Users/currentUser/Download/test"; 1812 let destFile: string = "file://docs/storage/Users/currentUser/Download/test"; 2498 | destFile | string | 是 | 目标文件夹的uri。 | [all …]
|
/ohos5.0/foundation/bundlemanager/bundle_framework/interfaces/kits/js/zip/include/ |
H A D | zip.h | 50 ZipParams(const std::vector<FilePath> &srcDir, const FilePath &destFile); 171 bool Unzip(const std::string &srcFile, const std::string &destFile, const OPTIONS options,
|
/ohos5.0/foundation/distributeddatamgr/relational_store/frameworks/native/rdb/include/ |
H A D | sqlite_utils.h | 55 static bool RenameFile(const std::string &srcFile, const std::string &destFile); 56 static bool CopyFile(const std::string &srcFile, const std::string &destFile);
|
/ohos5.0/foundation/multimedia/ringtone_library/frameworks/ringtone_extension_hap/RingtoneLibraryExt/entry/src/main/ets/RingtoneBackupExtAbility/ |
H A D | RingtoneBackupExtAbility.ts | 111 ….log(TAG, `move conflect file from [${conflictList[i].srcFile}] to [${conflictList[i].destFile}]`); 113 await this.moveConflictFile(conflictList[i].srcFile, conflictList[i].destFile);
|
/ohos5.0/docs/en/application-dev/file-management/ |
H A D | app-file-access.md | 95 …let destFile = fs.openSync(filesDir + '/destFile.txt', fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE… 110 fs.writeSync(destFile.fd, buf, writeOptions); 116 fs.closeSync(destFile); 140 let outputStream = fs.createStreamSync(filesDir + '/destFile.txt', "w+");
|
/ohos5.0/drivers/peripheral/thermal/interfaces/hdi_service/src/ |
H A D | thermal_dfx.cpp | 161 bool ThermalDfx::Compress(const std::string& dataFile, const std::string& destFile) in Compress() argument 171 std::unique_ptr<gzFile_s, decltype(&gzclose)> fgz(gzopen(destFile.c_str(), "wb"), gzclose); in Compress() 173 THERMAL_HILOGE(COMP_HDI, "Fail to call gzopen(%{public}s)", destFile.c_str()); in Compress()
|
/ohos5.0/foundation/filemanagement/app_file_service/frameworks/native/backup_ext/src/ |
H A D | untar_file.cpp | 452 FILE *destFile = CreateFile(info.fullPath); in ParseRegularFile() local 453 if (destFile != nullptr) { in ParseRegularFile() 463 fwrite(&destStr[0], sizeof(char), readBuffSize, destFile); in ParseRegularFile() 466 fclose(destFile); in ParseRegularFile()
|
/ohos5.0/drivers/peripheral/thermal/interfaces/hdi_service/include/ |
H A D | thermal_dfx.h | 46 bool Compress(const std::string& dataFile, const std::string& destFile);
|