Home | History | Annotate | Download | only in rawbu

Lines Matching full:path

49     const char* path;
63 static int wipe (const char *path)
70 dir = opendir(path);
74 path, strerror(errno));
80 strcpy(nameBuffer, path);
102 /* See if this is a path we should skip. */
103 for (i = 0; SKIP_PATHS[i].path; i++) {
104 if (strcmp(SKIP_PATHS[i].path, nameBuffer) == 0) {
116 if (!noBackup && SKIP_PATHS[i].path != NULL) {
150 strcpy(nameBuffer, path);
230 static int write_header(FILE* fh, int type, const char* path, const struct stat* st)
232 int pathLen = strlen(path);
235 if (fwrite(path, 1, pathLen, fh) != (size_t)pathLen) {
289 /* See if this is a path we should skip. */
291 for (i = 0; SKIP_PATHS[i].path; i++) {
292 if (strcmp(SKIP_PATHS[i].path, fullPath) == 0) {
296 if (SKIP_PATHS[i].path != NULL) {
424 static int read_header(FILE* fh, int* type, char** path, struct stat* st)
438 fprintf(stderr, "bad path length %d in restore file\n", pathLen);
443 fprintf(stderr, "truncated path in restore file\n");
448 *path = readPath;
521 char* path = NULL;
522 if (read_header(fh, &type, &path, &statBuffer) == 0) {
534 printf("Restoring dir %s...\n", path);
536 if (mkdir(path, statBuffer.st_mode) != 0) {
539 path, strerror(errno));
540 free(path);
550 free(path);
554 printf("Restoring file %s...\n", path);
556 FILE* dest = fopen(path, "w");
559 path, strerror(errno));
560 free(path);
564 int copyres = copy_file(dest, fh, size, path, NULL);
567 free(path);
578 if (chmod(path, statBuffer.st_mode&(S_IRWXU|S_IRWXG|S_IRWXO)) != 0) {
580 typeName, path, statBuffer.st_mode, strerror(errno));
581 free(path);
585 if (chown(path, statBuffer.st_uid, statBuffer.st_gid) != 0) {
587 typeName, path, (int)statBuffer.st_uid, (int)statBuffer.st_gid, strerror(errno));
588 free(path);
595 if (utime(path
597 typeName, path, strerror(errno));
598 free(path);
603 free(path);
616 fprintf(stderr,"Usage: %s COMMAND [options] [backup-file-path]\n", cmd);