Lines Matching refs:path

202 pathdup(const char *path)  in pathdup()  argument
207 len = strlen(path); in pathdup()
208 while (len && path[len - 1] == '/') in pathdup()
216 str[i] = tolower((unsigned char)path[i]); in pathdup()
218 memcpy(str, path, len); in pathdup()
227 pathcat(const char *prefix, const char *path) in pathcat() argument
233 len = strlen(path) + 1; in pathcat()
242 memcpy(str + prelen, path, len); /* includes zero */ in pathcat()
313 make_dir(const char *path, int mode) in make_dir() argument
317 if (lstat(path, &sb) == 0) { in make_dir()
333 (void)unlink(path); in make_dir()
335 if (mkdir(path, mode) != 0 && errno != EEXIST) in make_dir()
336 error("mkdir('%s')", path); in make_dir()
346 make_parent(char *path) in make_parent() argument
351 sep = strrchr(path, '/'); in make_parent()
352 if (sep == NULL || sep == path) in make_parent()
355 if (lstat(path, &sb) == 0) { in make_parent()
360 unlink(path); in make_parent()
362 make_parent(path); in make_parent()
363 mkdir(path, 0755); in make_parent()
367 for (sep = path; (sep = strchr(sep, '/')) != NULL; sep++) { in make_parent()
369 if (sep == path) in make_parent()
372 make_dir(path, 0755); in make_parent()
382 extract_dir(struct archive *a, struct archive_entry *e, const char *path) in extract_dir() argument
406 info(" creating: %s/\n", path); in extract_dir()
407 make_dir(path, mode); in extract_dir()
415 handle_existing_file(char **path) in handle_existing_file() argument
424 *path); in handle_existing_file()
438 (void)unlink(*path); in handle_existing_file()
449 free(*path); in handle_existing_file()
450 *path = NULL; in handle_existing_file()
452 len = getdelim(path, &alen, '\n', stdin); in handle_existing_file()
453 if ((*path)[len - 1] == '\n') in handle_existing_file()
454 (*path)[len - 1] = '\0'; in handle_existing_file()
582 extract_file(struct archive *a, struct archive_entry *e, char **path) in extract_file() argument
599 if (lstat(*path, &sb) == 0) { in extract_file()
607 (void)unlink(*path); in extract_file()
610 (void)unlink(*path); in extract_file()
615 check = handle_existing_file(path); in extract_file()
633 if (symlink(linkname, *path) != 0) in extract_file()
634 error("symlink('%s')", *path); in extract_file()
635 info(" extracting: %s -> %s\n", *path, linkname); in extract_file()
636 if (lchmod(*path, mode) != 0) in extract_file()
637 warning("Cannot set mode for '%s'", *path); in extract_file()
639 if (utimensat(AT_FDCWD, *path, ts, AT_SYMLINK_NOFOLLOW) != 0) in extract_file()
640 warning("utimensat('%s')", *path); in extract_file()
644 if ((fd = open(*path, O_RDWR|O_CREAT|O_TRUNC, mode)) < 0) in extract_file()
645 error("open('%s')", *path); in extract_file()
647 info(" extracting: %s", *path); in extract_file()
649 text = extract2fd(a, *path, fd); in extract_file()
659 error("futimens('%s')", *path); in extract_file()
661 error("close('%s')", *path); in extract_file()