From 91c092b4285c035852e9b944054cf49dcf2233ae Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 25 Jan 2008 17:54:47 +0000 Subject: [PATCH] New option -commit_eject --- test/ng_xorrisoburn.c | 17 ++++++++++++++++- test/xorriso.1 | 8 +++++++- test/xorriso.c | 23 ++++++++++++++++++++++- test/xorriso.h | 5 ++++- test/xorriso_timestamp.h | 2 +- 5 files changed, 50 insertions(+), 5 deletions(-) diff --git a/test/ng_xorrisoburn.c b/test/ng_xorrisoburn.c index d75c24c1..c5eff17f 100644 --- a/test/ng_xorrisoburn.c +++ b/test/ng_xorrisoburn.c @@ -423,8 +423,17 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag) int in_is_out_too, ret; struct burn_drive_info *dinfo; struct burn_drive *drive; + char sfe[5*SfileadrL]; in_is_out_too= (xorriso->in_drive_handle == xorriso->out_drive_handle); + if((flag&4) && in_is_out_too && (flag&(1|2))) { + if((flag&3)!=3) { + sprintf(xorriso->info_text,"Giving up for -eject whole -dev %s", + Text_shellsafe(xorriso->indev, sfe, 0)); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); + } + flag|= 3; /* give up in/out drive to eject it */ + } if((flag&1) && xorriso->in_drive_handle != NULL) { Xorriso_get_drive_handles(xorriso, &dinfo, &drive, @@ -449,7 +458,7 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag) } if((flag&2) && xorriso->out_drive_handle!=NULL) { Xorriso_get_drive_handles(xorriso, &dinfo, &drive, - "on attempt to give drive up", 2); + "on attempt to give up drive", 2); if(!in_is_out_too) { if(drive!=NULL) isoburn_drive_release(drive,!!(flag&4)); @@ -660,9 +669,15 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive, progress.sector, progress.sectors); ret= isoburn_get_fifo_status(drive, &size, &free_bytes, &status_text); if(ret>0 ) + sprintf(xorriso->info_text+strlen(xorriso->info_text), + " [fifo %s, %2d%% fill, size=%d , free=%d]", status_text, + (int) (100.0-100.0*((double) free_bytes)/(double) size), + size, free_bytes); +/* sprintf(xorriso->info_text+strlen(xorriso->info_text), " [fifo %s, %2d%% fill]", status_text, (int) (100.0-100.0*((double) free_bytes)/(double) size)); +*/ } else if(drive_status == BURN_DRIVE_CLOSING_SESSION || drive_status == BURN_DRIVE_CLOSING_TRACK) sprintf(xorriso->info_text, diff --git a/test/xorriso.1 b/test/xorriso.1 index 733dbf39..bb809e5c 100644 --- a/test/xorriso.1 +++ b/test/xorriso.1 @@ -2,7 +2,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH XORRISO 1 "January 21, 2008" +.TH XORRISO 1 "January 25, 2008" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -725,6 +725,7 @@ are uncommitted manipulations pending. So, to perform a final write operation with no new -dev and no new loading of image, rather execute option -end. To suppress a final write, execute -rollback -end. +To eject outdev after write without new loading of image, use -commit_eject. .br Writing can last quite a while. It is not unnormal with several @@ -741,6 +742,11 @@ for such failure is hardly ever in the code of the various burn programs but you may well try some of those listed below under SEE ALSO. .TP +\fB\-commit_eject\fR +Like -commit. But when writing has finished it does not make +-outdev the new -dev, and it loads no ISO image. It rather ejects +-outdev and gives up -indev. +.TP \fB\-eject\fR "in"|"out"|"all" Eject the media in -indev, resp. -outdev, resp. both drives. Note: It is not possible yet to effectively eject disk files. diff --git a/test/xorriso.c b/test/xorriso.c index 4faf7d65..851e8511 100644 --- a/test/xorriso.c +++ b/test/xorriso.c @@ -6513,6 +6513,22 @@ int Xorriso_option_commit(struct XorrisO *xorriso, int flag) } +/* Option -commit_eject */ +int Xorriso_option_commit_eject(struct XorrisO *xorriso, int flag) +{ + int ret, eret; + + ret= Xorriso_option_commit(xorriso, 1); + if(ret<=0) + return(ret); + eret= Xorriso_option_eject(xorriso, "out", 0); + ret= Xorriso_option_dev(xorriso, "", 1); + if(eret