Lines Matching defs:path

200 /* duplicate a path name, possibly converting to lower case */
202 pathdup(const char *path)
207 len = strlen(path);
208 while (len && path[len - 1] == '/')
216 str[i] = tolower((unsigned char)path[i]);
218 memcpy(str, path, len);
225 /* concatenate two path names */
227 pathcat(const char *prefix, const char *path)
233 len = strlen(path) + 1;
242 memcpy(str + prelen, path, len); /* includes zero */
313 make_dir(const char *path, int mode)
317 if (lstat(path, &sb) == 0) {
333 (void)unlink(path);
335 if (mkdir(path, mode) != 0 && errno != EEXIST)
336 error("mkdir('%s')", path);
341 * specified path exist.
346 make_parent(char *path)
351 sep = strrchr(path, '/');
352 if (sep == NULL || sep == path)
355 if (lstat(path, &sb) == 0) {
360 unlink(path);
362 make_parent(path);
363 mkdir(path, 0755);
367 for (sep = path; (sep = strchr(sep, '/')) != NULL; sep++) {
369 if (sep == path)
372 make_dir(path, 0755);
382 extract_dir(struct archive *a, struct archive_entry *e, const char *path)
406 info(" creating: %s/\n", path);
407 make_dir(path, mode);
415 handle_existing_file(char **path)
424 *path);
438 (void)unlink(*path);
449 free(*path);
450 *path = NULL;
452 len = getdelim(path, &alen, '\n', stdin);
453 if ((*path)[len - 1] == '\n')
454 (*path)[len - 1] = '\0';
582 extract_file(struct archive *a, struct archive_entry *e, char **path)
599 if (lstat(*path, &sb) == 0) {
607 (void)unlink(*path);
610 (void)unlink(*path);
615 check = handle_existing_file(path);
633 if (symlink(linkname, *path) != 0)
634 error("symlink('%s')", *path);
635 info(" extracting: %s -> %s\n", *path, linkname);
636 if (lchmod(*path, mode) != 0)
637 warning("Cannot set mode for '%s'", *path);
639 if (utimensat(AT_FDCWD, *path, ts, AT_SYMLINK_NOFOLLOW) != 0)
640 warning("utimensat('%s')", *path);
644 if ((fd = open(*path, O_RDWR|O_CREAT|O_TRUNC, mode)) < 0)
645 error("open('%s')", *path);
647 info(" extracting: %s", *path);
649 text = extract2fd(a, *path, fd);
659 error("futimens('%s')", *path);
661 error("close('%s')", *path);
666 * that it is either a directory or a regular file and that the path is
671 * manipulate the path name. Case conversion (if requested by the -L
673 * to the full converted path name, before the directory part of the path