From 5f4e9d9cfb49fe26d0ffef3e0f78ed316ccb3c68 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 27 Dec 2006 16:30:25 +0000 Subject: [PATCH] Emulated wodim option -msifile=path --- cdrskin/cdrskin.1 | 5 +++++ cdrskin/cdrskin.c | 41 ++++++++++++++++++++++++++++++++++++- cdrskin/cdrskin_timestamp.h | 2 +- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/cdrskin/cdrskin.1 b/cdrskin/cdrskin.1 index 2168135..dab0205 100644 --- a/cdrskin/cdrskin.1 +++ b/cdrskin/cdrskin.1 @@ -253,6 +253,11 @@ option fifo_start_at=size. .BI gracetime= seconds Set the grace time before starting to write. (Default is 0) .TP +.BI msifile= path +Run option -msinfo and copy the result line into the file given by path. +Unlike -msinfo this option does not redirect all normal output away from +standard output. But it may be combined with -msinfo to achieve this. +.TP .BI \-msinfo Retrieve multi-session info for preparing a follow-up session by option -C of programs mkisofs or genisoimage. Print result to standard output. diff --git a/cdrskin/cdrskin.c b/cdrskin/cdrskin.c index 34d4659..53c0df6 100644 --- a/cdrskin/cdrskin.c +++ b/cdrskin/cdrskin.c @@ -2097,6 +2097,7 @@ see_cdrskin_eng_html:; #ifdef Cdrskin_libburn_has_multI fprintf(stderr, "\t-msinfo\t\tretrieve multi-session info for mkisofs >= 1.10\n"); + fprintf(stderr,"\tmsifile=path\trun -msinfo and copy output to file\n"); #endif fprintf(stderr,"\t-toc\t\tretrieve and print TOC/PMA data\n"); fprintf(stderr, @@ -2366,6 +2367,7 @@ struct CdrskiN { int do_msinfo; int msinfo_fd; + char msifile[Cdrskin_strleN]; int do_atip; @@ -2490,6 +2492,7 @@ int Cdrskin_new(struct CdrskiN **skin, struct CdrpreskiN *preskin, int flag) o->do_checkdrive= 0; o->do_msinfo= 0; o->msinfo_fd= -1; + o->msifile[0]= 0; o->do_atip= 0; o->do_blank= 0; o->blank_fast= 0; @@ -3536,6 +3539,21 @@ int Cdrskin_msinfo(struct CdrskiN *skin, int flag) write(skin->msinfo_fd,msg,strlen(msg)); } else printf("%d,%d\n",lba,nwa); + + if(strlen(skin->msifile)) { + FILE *fp; + + fp = fopen(skin->msifile, "w"); + if(fp==NULL) { + if(errno>0) + fprintf(stderr,"cdrskin: %s (errno=%d)\n", strerror(errno), errno); + fprintf(stderr,"cdrskin: FATAL : Cannot write msinfo to file '%s'\n", + skin->msifile); + {ret= 0; goto ex;} + } + fprintf(fp,"%d,%d\n",lba,nwa); + fclose(fp); + } ret= 1; ex:; @@ -5215,11 +5233,32 @@ gracetime_equals:; fprintf(stderr,"cdrskin: SORRY : Option -multi is not available yet.\n"); #endif + } else if(strncmp(argv[i],"-msifile=",9)==0) { + value_pt= argv[i]+9; + goto msifile_equals; + } else if(strncmp(argv[i],"msifile=",8)==0) { + value_pt= argv[i]+8; +msifile_equals:; +#ifdef Cdrskin_libburn_has_multI + if(strlen(value_pt)>=sizeof(skin->msifile)) { + fprintf(stderr, + "cdrskin: FATAL : msifile=... too long. (max: %d, given: %d)\n", + sizeof(skin->msifile)-1,strlen(value_pt)); + return(0); + } + strcpy(skin->msifile, value_pt); + skin->do_msinfo= 1; +#else + fprintf(stderr, + "cdrskin: SORRY : Option msifile= is not available.\n"); + return(0); +#endif + } else if(strcmp(argv[i],"-msinfo")==0) { #ifdef Cdrskin_libburn_has_multI skin->do_msinfo= 1; #else - fprintf(stderr,"cdrskin: SORRY : Option -msinfo is not available yet.\n"); + fprintf(stderr,"cdrskin: SORRY : Option -msinfo is not available.\n"); return(0); #endif diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 0c9b5d7..712ce1b 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2006.12.27.132653" +#define Cdrskin_timestamP "2006.12.27.162846"