Lines Matching refs:path

204 /* duplicate a path name, possibly converting to lower case */
206 pathdup(const char *path)
211 len = strlen(path);
212 while (len && path[len - 1] == '/')
220 str[i] = tolower((unsigned char)path[i]);
222 memcpy(str, path, len);
229 /* concatenate two path names */
231 pathcat(const char *prefix, const char *path)
237 len = strlen(path) + 1;
246 memcpy(str + prelen, path, len); /* includes zero */
317 make_dir(const char *path, int mode)
321 if (lstat(path, &sb) == 0) {
337 (void)unlink(path);
339 if (mkdir(path, mode) != 0 && errno != EEXIST)
340 error("mkdir('%s')", path);
345 * specified path exist.
350 make_parent(char *path)
355 sep = strrchr(path, '/');
356 if (sep == NULL || sep == path)
359 if (lstat(path, &sb) == 0) {
364 unlink(path);
366 make_parent(path);
367 mkdir(path, 0755);
371 for (sep = path; (sep = strchr(sep, '/')) != NULL; sep++) {
373 if (sep == path)
376 make_dir(path, 0755);
386 extract_dir(struct archive *a, struct archive_entry *e, const char *path)
410 info("d %s\n", path);
411 make_dir(path, mode);
419 handle_existing_file(char **path)
428 *path);
442 (void)unlink(*path);
453 free(*path);
454 *path = NULL;
456 len = getdelim(path, &alen, '\n', stdin);
457 if ((*path)[len - 1] == '\n')
458 (*path)[len - 1] = '\0';
470 extract_file(struct archive *a, struct archive_entry *e, char **path)
487 if (lstat(*path, &sb) == 0) {
492 (void)unlink(*path);
495 (void)unlink(*path);
500 check = handle_existing_file(path);
511 if ((fd = open(*path, O_RDWR|O_CREAT|O_TRUNC, mode)) < 0)
512 error("open('%s')", *path);
515 info(" extracting: %s", *path);
532 error("write('%s')", *path);
563 error("write('%s')", *path);
573 " heuristic", *path);
586 error("write('%s')", *path);
601 error("utimes('%s')", *path);
603 error("close('%s')", *path);
608 * that it is either a directory or a regular file and that the path is
613 * manipulate the path name. Case conversion (if requested by the -L
615 * to the full converted path name, before the directory part of the path