e2cp.exe: e2cp.c cache.c common.c list.c report.c
- $(CC) $(CFLAGS) -o $@ $^
\ No newline at end of file
+ $(CC) $(CFLAGS) -o $@ $^
}
-static void copy_file (struct filesystem *fs, FILE *fp, unsigned long parent, char *fn) {
+static void copy_file (struct filesystem *fs, FILE *fp, unsigned long parent_nod, char *fn) {
unsigned long bytes = 0, timestamp = time (0);
char *basename = fn, *p;
basename = (p + 1);
}
+ if (find_entry (fs, parent_nod, basename)) {
+
+ report_at (program_name, 0, REPORT_ERROR, "'%s' already exists. Currently replacing files isn't supported.", basename);
+ return;
+
+ }
+
fseek (fp, 0, SEEK_END);
bytes = ftell (fp);
fseek (fp, 0, SEEK_SET);
- mkfile_fs (fs, parent, basename, fp, bytes, 0, 0, timestamp, timestamp);
+ mkfile_fs (fs, parent_nod, basename, fp, bytes, 0, 0, timestamp, timestamp);
}