Lines Matching defs:destPath
205 void CopyImpl::CheckOrCreatePath(const std::string &destPath)
207 if (!std::filesystem::exists(destPath)) {
208 LOGI("destPath not exist, destPath = %{public}s", destPath.c_str());
209 auto file = open(destPath.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
228 int CopyImpl::CopySubDir(const std::string &srcPath, const std::string &destPath, std::shared_ptr<FileInfos> infos)
230 if (!std::filesystem::exists(destPath)) {
231 int res = MakeDir(destPath);
239 int newWd = inotify_add_watch(infos->notifyFd, destPath.c_str(), watchEvents);
252 receiveInfo->path = destPath;
254 LOGE("Failed to find infos, srcPath = %{public}s, destPath = %{public}s", infos->srcPath.c_str(),
255 infos->destPath.c_str());
261 return RecurCopyDir(srcPath, destPath, infos);
264 int CopyImpl::RecurCopyDir(const std::string &srcPath, const std::string &destPath, std::shared_ptr<FileInfos> infos)
276 std::string dest = destPath + '/' + std::string((pNameList->namelist[i])->d_name);
365 infos->destPath = destFileUri.GetPath();
367 infos->destPath = GetRealPath(infos->destPath);
564 if (IsFile(infos->srcPath) && IsFile(infos->destPath)) {
566 return CopyFile(infos->srcPath.c_str(), infos->destPath.c_str(), infos);
568 if (IsDirectory(infos->srcPath) && IsDirectory(infos->destPath)) {
572 if (infos->destPath.back() != '/') {
573 infos->destPath += '/';
576 return CopyDirFunc(infos->srcPath.c_str(), infos->destPath.c_str(), infos);
643 if (infos->srcPath == infos->destPath) {
647 CheckOrCreatePath(infos->destPath);
675 int newWd = inotify_add_watch(infos->notifyFd, infos->destPath.c_str(), IN_MODIFY);
677 LOGE("Failed to add watch, errno = %{public}d, notifyFd: %{public}d, destPath: %{public}s",
678 errno, infos->notifyFd, infos->destPath.c_str());
689 receiveInfo->path = infos->destPath;