Skip to content

Commit

Permalink
check whether output file exist
Browse files Browse the repository at this point in the history
  • Loading branch information
tobefuturer committed Dec 27, 2017
1 parent a4479ac commit b242c47
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions source/restore-symbol.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,19 @@ void restore_symbol(NSString * inpath, NSString *outpath, NSString *jsonPath, bo
}



if ([outpath length] == 0) {
fprintf(stderr, "Error: No output file path!\n");
exit(1);
}

if ([[NSFileManager defaultManager] fileExistsAtPath:outpath]) {
fprintf(stderr, "Error: Output file has exist!\n");
exit(1);
}

fprintf(stderr, "=========== Start =============\n");




[[NSFileManager defaultManager] removeItemAtPath:outpath error:nil];

NSMutableData * outData = [[NSMutableData alloc] initWithContentsOfFile:inpath];

CDFile * ofile = [CDFile fileWithContentsOfFile:inpath searchPathState:nil];
Expand Down

0 comments on commit b242c47

Please sign in to comment.