Lines Matching refs:path
51 const char* path; member
65 static int wipe (const char *path) in wipe() argument
72 dir = opendir(path); in wipe()
76 path, strerror(errno)); in wipe()
82 strcpy(nameBuffer, path); in wipe()
105 for (i = 0; SKIP_PATHS[i].path; i++) { in wipe()
106 if (strcmp(SKIP_PATHS[i].path, nameBuffer) == 0) { in wipe()
118 if (!noBackup && SKIP_PATHS[i].path != NULL) { in wipe()
152 strcpy(nameBuffer, path); in wipe()
236 static int write_header(FILE* fh, int type, const char* path, const struct stat* st) in write_header() argument
238 int pathLen = strlen(path); in write_header()
241 if (fwrite(path, 1, pathLen, fh) != (size_t)pathLen) { in write_header()
297 for (i = 0; SKIP_PATHS[i].path; i++) { in backup_dir()
298 if (strcmp(SKIP_PATHS[i].path, fullPath) == 0) { in backup_dir()
302 if (SKIP_PATHS[i].path != NULL) { in backup_dir()
438 static int read_header(FILE* fh, int* type, char** path, struct stat* st) in read_header() argument
462 *path = readPath; in read_header()
538 char* path = NULL; in restore_data() local
539 if (read_header(fh, &type, &path, &statBuffer) == 0) { in restore_data()
551 printf("Restoring dir %s...\n", path); in restore_data()
553 if (mkdir(path, statBuffer.st_mode) != 0) { in restore_data()
556 path, strerror(errno)); in restore_data()
557 free(path); in restore_data()
567 free(path); in restore_data()
571 printf("Restoring file %s...\n", path); in restore_data()
573 FILE* dest = fopen(path, "w"); in restore_data()
576 path, strerror(errno)); in restore_data()
577 free(path); in restore_data()
581 int copyres = copy_file(dest, fh, size, path, NULL); in restore_data()
584 free(path); in restore_data()
595 if (chmod(path, statBuffer.st_mode&(S_IRWXU|S_IRWXG|S_IRWXO)) != 0) { in restore_data()
597 typeName, path, statBuffer.st_mode, strerror(errno)); in restore_data()
598 free(path); in restore_data()
602 if (chown(path, statBuffer.st_uid, statBuffer.st_gid) != 0) { in restore_data()
604 typeName, path, (int)statBuffer.st_uid, (int)statBuffer.st_gid, strerror(errno)); in restore_data()
605 free(path); in restore_data()
612 if (utime(path, &timbuf) != 0) { in restore_data()
614 typeName, path, strerror(errno)); in restore_data()
615 free(path); in restore_data()
620 free(path); in restore_data()