diff --git a/source/restore-symbol.m b/source/restore-symbol.m index 3653ec2..3dae5fc 100644 --- a/source/restore-symbol.m +++ b/source/restore-symbol.m @@ -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];