Lines Matching defs:from
5 * This code is derived from software contributed to Berkeley by
17 * may be used to endorse or promote products derived from this software
174 do_move(const char *from, const char *to)
188 if (lstat(from, &sb) == -1) {
189 warn("%s", from);
225 if (!rename(from, to)) {
227 printf("%s -> %s\n", from, to);
239 if (lstat(from, &sb) == -1) {
240 warn("%s", from);
245 if (realpath(from, path) == NULL) {
246 warn("cannot resolve %s: %s", from, path);
256 warn("rename %s to %s", from, to);
265 if (lstat(from, &sb)) {
266 warn("%s", from);
270 fastcopy(from, to, &sb) : copy(from, to));
274 fastcopy(const char *from, const char *to, struct stat *sbp)
282 if ((from_fd = open(from, O_RDONLY, 0)) < 0) {
283 warn("fastcopy: open() failed (from): %s", from);
304 warn("fastcopy: read() failed: %s", from);
330 preserve_fd_acls(from_fd, to_fd, from, to);
355 if (unlink(from)) {
356 warn("%s: remove", from);
360 printf("%s -> %s\n", from, to);
365 copy(const char *from, const char *to)
390 execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", "--", from, to,
395 warn("%s %s %s: waitpid", _PATH_CP, from, to);
400 _PATH_CP, from, to);
407 warnx("%s %s %s: exec failed", _PATH_CP, from, to);
411 _PATH_CP, from, to, WEXITSTATUS(status));
417 execl(_PATH_RM, "mv", "-rf", "--", from, (char *)NULL);
421 warn("%s %s: waitpid", _PATH_RM, from);
425 warnx("%s %s: did not terminate normally", _PATH_RM, from);
432 warnx("%s %s: exec failed", _PATH_RM, from);
436 _PATH_RM, from, WEXITSTATUS(status));