Home | History | Annotate | Download | only in adb

Lines Matching refs:lpath

75     std::string lpath;
86 : lpath(local_path), rpath(remote_path), mode(mode) {
87 ensure_trailing_separators(lpath, rpath);
88 lpath.append(name);
91 ensure_trailing_separators(lpath, rpath);
375 const char* lpath, const char* rpath,
409 WriteOrDie(lpath, rpath, &buf[0], (p - &buf[0]));
419 const char* lpath, const char* rpath,
427 if (stat(lpath, &st) == -1) {
428 Error("cannot stat '%s': %s", lpath, strerror(errno));
435 int lfd = adb_open(lpath, O_RDONLY);
437 Error("opening '%s' locally failed: %s", lpath, strerror(errno));
446 Error("reading '%s' locally failed: %s", lpath, strerror(errno));
454 WriteOrDie(lpath, rpath, &sbuf, sizeof(SyncRequest) + bytes_read);
460 if (ReceivedError(lpath, rpath)) {
475 return WriteOrDie(lpath, rpath, &msg.data, sizeof(msg.data));
677 static bool sync_send(SyncConnection& sc, const char* lpath, const char* rpath, unsigned mtime,
696 ssize_t data_length = readlink(lpath, buf, PATH_MAX - 1);
698 sc.Error("readlink '%s' failed: %s", lpath, strerror(errno));
703 if (!sc.SendSmallFile(path_and_mode.c_str(), lpath, rpath, mtime, buf, data_length)) {
706 return sc.CopyDone(lpath, rpath);
711 if (stat(lpath, &st) == -1) {
712 sc.Error("failed to stat local file '%s': %s", lpath, strerror(errno));
717 if (!android::base::ReadFileToString(lpath, &data, true)) {
718 sc.Error("failed to read all of '%s': %s", lpath, strerror(errno));
721 if (!sc.SendSmallFile(path_and_mode.c_str(), lpath, rpath, mtime,
726 if (!sc.SendLargeFile(path_and_mode.c_str(), lpath, rpath, mtime)) {
730 return sc.CopyDone(lpath, rpath);
733 static bool sync_recv(SyncConnection& sc, const char* rpath, const char* lpath,
737 adb_unlink(lpath);
738 int lfd = adb_creat(lpath, 0644);
740 sc.Error("cannot create '%s': %s", lpath, strerror(errno));
749 adb_unlink(lpath);
757 adb_unlink(lpath);
758 sc.ReportCopyFailure(rpath, lpath, msg);
765 adb_unlink(lpath);
772 adb_unlink(lpath);
777 sc.Error("cannot write '%s': %s", lpath, strerror(errno));
779 adb_unlink(lpath);
809 const std::string& lpath,
812 std::unique_ptr<DIR, int (*)(DIR*)> dir(opendir(lpath.c_str()), closedir);
814 sc.Error("cannot open '%s': %s", lpath.c_str(), strerror(errno));
826 std::string stat_path = lpath + de->d_name;
835 copyinfo ci(lpath, rpath, de->d_name, st.st_mode);
840 sc.Warning("skipping special file '%s' (mode = 0o%o)", lpath.c_str(), st.st_mode);
857 sc.Warning("skipping empty directory '%s'", lpath.c_str());
858 copyinfo ci(android::base::Dirname(lpath), android::base::Dirname(rpath),
859 android::base::Basename(lpath), S_IFDIR);
866 local_build_list(sc, file_list, ci.lpath, ci.rpath);
872 static bool copy_local_dir_remote(SyncConnection& sc, std::string lpath,
879 ensure_trailing_separators(lpath, rpath);
884 if (!local_build_list(sc, &file_list, lpath, rpath)) {
914 sc.Println("would push: %s -> %s", ci.lpath.c_str(), ci.rpath.c_str());
916 if (!sync_send(sc, ci.lpath.c_str(), ci.rpath.c_str(), ci.time, ci.mode, false)) {
926 sc.ReportTransferRate(lpath, TransferDirection::push);
1025 const std::string& rpath, const std::string& lpath) {
1030 copyinfo ci(android::base::Dirname(lpath), android::base::Dirname(rpath),
1031 android::base::Basename(lpath), S_IFDIR);
1040 copyinfo ci(lpath, rpath, name, mode);
1079 if (!remote_build_list(sc, file_list, current.rpath, current.lpath)) {
1087 static int set_time_and_mode(const std::string& lpath, time_t time,
1090 int r1 = utime(lpath.c_str(), &times);
1095 int r2 = chmod(lpath.c_str(), mode & ~mask);
1101 std::string lpath, bool copy_attrs) {
1106 ensure_trailing_separators(lpath, rpath);
1111 if (!remote_build_list(sc, &file_list, rpath.c_str(), lpath.c_str())) {
1123 if (!mkdirs(ci.lpath)) {
1125 ci.lpath.c_str(), strerror(errno));
1131 if (!sync_recv(sc, ci.rpath.c_str(), ci.lpath.c_str(), nullptr, ci.size)) {
1135 if (copy_attrs && set_time_and_mode(ci.lpath, ci.time, ci.mode)) {
1258 bool do_sync_sync(const std::string& lpath, const std::string& rpath, bool list_only) {
1262 bool success = copy_local_dir_remote(sc, lpath, rpath, true, list_only);