Lines Matching full:path
206 // with a path isn't a builtin, so /bin/sh won't match the builtin sh.
358 void xaccess(char *path, int flags)
360 if (access(path, flags)) perror_exit("Can't access '%s'", path);
364 void xunlink(char *path)
366 if (unlink(path)) perror_exit("unlink '%s'", path);
372 int xcreate_stdio(char *path, int flags, int mode)
374 int fd = open(path, (flags^O_CLOEXEC)&~WARN_ONLY, mode);
376 if (fd == -1) ((mode&WARN_ONLY) ? perror_msg_raw : perror_exit_raw)(path);
381 int xopen_stdio(char *path, int flags)
383 return xcreate_stdio(path, flags, 0);
438 int xcreate(char *path, int flags, int mode)
440 return notstdio(xcreate_stdio(path, flags, mode));
444 int xopen(char *path, int flags)
446 return notstdio(xopen_stdio(path, flags));
450 int openro(char *path, int flags)
452 if (!strcmp(path, "-")) return 0;
454 return xopen(path, flags^WARN_ONLY);
458 int xopenro(char *path)
460 return openro(path, O_RDONLY|WARN_ONLY);
473 FILE *xfopen(char *path, char *mode)
475 FILE *f = fopen(path, mode);
476 if (!f) perror_exit("No file %s", path);
521 void xstat(char *path, struct stat *st)
523 if(stat(path, st)) perror_exit("Can't stat %s", path);
526 // Canonicalize path, even to file with one or more missing components at end.
529 char *xabspath(char *path, int exact)
535 // If this isn't an absolute path, start with cwd.
536 if (*path != '/') {
539 splitpath(path, splitpath(temp, &todo));
541 } else splitpath(path, &todo);
543 // Iterate through path components in todo, prepend processed ones to done.
554 // Removable path componenents.
596 // If this symlink is to an absolute path, discard existing resolved path
606 // prepend components of new path. Note symlink to "/" will leave new NULL
617 // At this point done has the path, in reverse order. Reverse list while
651 void xchdir(char *path)
653 if (chdir(path)) perror_exit("chdir '%s'", path);
656 void xchroot(char *path)
658 if (chroot(path)) error_exit("chroot '%s'", path);