|
Lines 211-216
Link Here
|
| 211 |
" -q --quiet : quiet operation\n" |
218 |
" -q --quiet : quiet operation\n" |
| 212 |
" -e --stderr-progress : force output of progress information to\n" |
219 |
" -e --stderr-progress : force output of progress information to\n" |
| 213 |
" stderr (for wrapper scripts)\n" |
220 |
" stderr (for wrapper scripts)\n" |
|
|
221 |
" -l --log-summary <file> : save result summary to file\n" |
| 214 |
" -V --version : print version info and quit\n" |
222 |
" -V --version : print version info and quit\n" |
| 215 |
" -Q --query : autosense drive, query disc and quit\n" |
223 |
" -Q --query : autosense drive, query disc and quit\n" |
| 216 |
" -B --batch : 'batch' mode (saves each track to a\n" |
224 |
" -B --batch : 'batch' mode (saves each track to a\n" |
|
Lines 342-347
Link Here
|
| 342 |
|
350 |
|
| 343 |
static int skipped_flag=0; |
351 |
static int skipped_flag=0; |
| 344 |
static int abort_on_skip=0; |
352 |
static int abort_on_skip=0; |
|
|
353 |
FILE *logfile = NULL; |
| 345 |
static void callback(long inpos, int function){ |
354 |
static void callback(long inpos, int function){ |
| 346 |
/* |
355 |
/* |
| 347 |
|
356 |
|
|
Lines 552-567
Link Here
|
| 552 |
} |
561 |
} |
| 553 |
|
562 |
|
| 554 |
fprintf(stderr,buffer); |
563 |
fprintf(stderr,buffer); |
|
|
564 |
|
| 565 |
if (logfile != NULL && function==-1) { |
| 566 |
fprintf(logfile,buffer+1); |
| 567 |
fprintf(logfile,"\n\n"); |
| 568 |
fflush(logfile); |
| 569 |
} |
| 555 |
} |
570 |
} |
| 556 |
} |
571 |
} |
| 557 |
} |
572 |
} |
| 558 |
|
573 |
|
| 559 |
/* clear the indicator for next batch */ |
574 |
/* clear the indicator for next batch */ |
| 560 |
if(function==-1) |
575 |
if(function==-1) |
| 561 |
memset(dispcache,' ',graph); |
576 |
memset(dispcache,' ',graph); |
| 562 |
} |
577 |
} |
| 563 |
|
578 |
|
| 564 |
const char *optstring = "escCn:o:O:d:g:S:prRwafvqVQhZz::YXWBi:Tt:"; |
579 |
const char *optstring = "escCn:o:O:d:g:S:prRwafvqVQhZz::YXWBi:Tt:l:"; |
| 565 |
|
580 |
|
| 566 |
struct option options [] = { |
581 |
struct option options [] = { |
| 567 |
{"stderr-progress",no_argument,NULL,'e'}, |
582 |
{"stderr-progress",no_argument,NULL,'e'}, |
|
Lines 594-599
Link Here
|
| 594 |
{"disable-fragmentation",no_argument,NULL,'F'}, |
609 |
{"disable-fragmentation",no_argument,NULL,'F'}, |
| 595 |
{"output-info",required_argument,NULL,'i'}, |
610 |
{"output-info",required_argument,NULL,'i'}, |
| 596 |
{"never-skip",optional_argument,NULL,'z'}, |
611 |
{"never-skip",optional_argument,NULL,'z'}, |
|
|
612 |
{"log-summary",required_argument,NULL,'l'}, |
| 597 |
|
613 |
|
| 598 |
{NULL,0,NULL,0} |
614 |
{NULL,0,NULL,0} |
| 599 |
}; |
615 |
}; |
|
Lines 763-768
Link Here
|
| 763 |
case 't': |
779 |
case 't': |
| 764 |
toc_offset=atoi(optarg); |
780 |
toc_offset=atoi(optarg); |
| 765 |
break; |
781 |
break; |
|
|
782 |
case 'l': |
| 783 |
if(logfile && logfile != stdout)fclose(logfile); |
| 784 |
if(!strcmp(optarg,"-")) |
| 785 |
logfile=stdout; |
| 786 |
else{ |
| 787 |
logfile=fopen(optarg,"w"); |
| 788 |
if(logfile==NULL){ |
| 789 |
report3("Cannot open log summary file %s: %s",(char*)optarg, |
| 790 |
strerror(errno)); |
| 791 |
exit(1); |
| 792 |
} |
| 793 |
} |
| 794 |
|
| 795 |
break; |
| 766 |
case 'O': |
796 |
case 'O': |
| 767 |
sample_offset=atoi(optarg); |
797 |
sample_offset=atoi(optarg); |
| 768 |
break; |
798 |
break; |
|
Lines 772-777
Link Here
|
| 772 |
} |
802 |
} |
| 773 |
} |
803 |
} |
| 774 |
|
804 |
|
|
|
805 |
if(logfile){ |
| 806 |
/* log command line and version */ |
| 807 |
int i; |
| 808 |
for (i = 0; i < argc; i++) |
| 809 |
fprintf(logfile,"%s ",argv[i]); |
| 810 |
fprintf(logfile,"\n",argv[i]); |
| 811 |
|
| 812 |
fprintf(logfile,VERSION); |
| 813 |
fprintf(logfile,"\n"); |
| 814 |
fflush(logfile); |
| 815 |
} |
| 816 |
|
| 775 |
if(optind>=argc && !query_only){ |
817 |
if(optind>=argc && !query_only){ |
| 776 |
if(batch) |
818 |
if(batch) |
| 777 |
span=NULL; |
819 |
span=NULL; |
|
Lines 1052-1057
Link Here
|
| 1052 |
if(batch)report("Are you sure you wanted 'batch' " |
1094 |
if(batch)report("Are you sure you wanted 'batch' " |
| 1053 |
"(-B) output with stdout?"); |
1095 |
"(-B) output with stdout?"); |
| 1054 |
report("outputting to stdout\n"); |
1096 |
report("outputting to stdout\n"); |
|
|
1097 |
if(logfile){ |
| 1098 |
fprintf(logfile,"outputting to stdout\n"); |
| 1099 |
fflush(logfile); |
| 1100 |
} |
| 1055 |
outfile_name[0]='\0'; |
1101 |
outfile_name[0]='\0'; |
| 1056 |
}else{ |
1102 |
}else{ |
| 1057 |
char path[256]; |
1103 |
char path[256]; |
|
Lines 1096-1101
Link Here
|
| 1096 |
exit(1); |
1142 |
exit(1); |
| 1097 |
} |
1143 |
} |
| 1098 |
report2("outputting to %s\n",outfile_name); |
1144 |
report2("outputting to %s\n",outfile_name); |
|
|
1145 |
if(logfile){ |
| 1146 |
fprintf(logfile,"outputting to %s\n",outfile_name); |
| 1147 |
fflush(logfile); |
| 1148 |
} |
| 1099 |
} |
1149 |
} |
| 1100 |
}else{ |
1150 |
}else{ |
| 1101 |
/* default */ |
1151 |
/* default */ |
|
Lines 1128-1133
Link Here
|
| 1128 |
exit(1); |
1178 |
exit(1); |
| 1129 |
} |
1179 |
} |
| 1130 |
report2("outputting to %s\n",outfile_name); |
1180 |
report2("outputting to %s\n",outfile_name); |
|
|
1181 |
if(logfile){ |
| 1182 |
fprintf(logfile,"outputting to %s\n",outfile_name); |
| 1183 |
fflush(logfile); |
| 1184 |
} |
| 1131 |
} |
1185 |
} |
| 1132 |
|
1186 |
|
| 1133 |
switch(output_type){ |
1187 |
switch(output_type){ |
|
Lines 1270-1274
Link Here
|
| 1270 |
|
1324 |
|
| 1271 |
cdda_close(d); |
1325 |
cdda_close(d); |
| 1272 |
d=NULL; |
1326 |
d=NULL; |
|
|
1327 |
if(logfile && logfile != stdout) |
| 1328 |
fclose(logfile); |
| 1273 |
return 0; |
1329 |
return 0; |
| 1274 |
} |
1330 |
} |