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 != nullptr) { in wipe()
151 strcpy(nameBuffer, path); in wipe()
235 static int write_header(FILE* fh, int type, const char* path, const struct stat* st) in write_header() argument
237 int pathLen = strlen(path); in write_header()
240 if (fwrite(path, 1, pathLen, fh) != (size_t)pathLen) { in write_header()
296 for (i = 0; SKIP_PATHS[i].path; i++) { in backup_dir()
297 if (strcmp(SKIP_PATHS[i].path, fullPath) == 0) { in backup_dir()
301 if (SKIP_PATHS[i].path != nullptr) { in backup_dir()
437 static int read_header(FILE* fh, int* type, char** path, struct stat* st) in read_header() argument
461 *path = readPath; in read_header()
537 char* path = nullptr; in restore_data() local
538 if (read_header(fh, &type, &path, &statBuffer) == 0) { in restore_data()
550 printf("Restoring dir %s...\n", path); in restore_data()
552 if (mkdir(path, statBuffer.st_mode) != 0) { in restore_data()
555 path, strerror(errno)); in restore_data()
556 free(path); in restore_data()
566 free(path); in restore_data()
570 printf("Restoring file %s...\n", path); in restore_data()
572 FILE* dest = fopen(path, "w"); in restore_data()
575 path, strerror(errno)); in restore_data()
576 free(path); in restore_data()
580 int copyres = copy_file(dest, fh, size, path, nullptr); in restore_data()
583 free(path); in restore_data()
594 if (chmod(path, statBuffer.st_mode&(S_IRWXU|S_IRWXG|S_IRWXO)) != 0) { in restore_data()
596 typeName, path, statBuffer.st_mode, strerror(errno)); in restore_data()
597 free(path); in restore_data()
601 if (chown(path, statBuffer.st_uid, statBuffer.st_gid) != 0) { in restore_data()
603 typeName, path, (int)statBuffer.st_uid, (int)statBuffer.st_gid, strerror(errno)); in restore_data()
604 free(path); in restore_data()
611 if (utime(path, &timbuf) != 0) { in restore_data()
613 typeName, path, strerror(errno)); in restore_data()
614 free(path); in restore_data()
619 free(path); in restore_data()