New option -commit_eject

This commit is contained in:
Thomas Schmitt 2008-01-25 17:54:47 +00:00
parent 05fabf5149
commit 91c092b428
5 changed files with 50 additions and 5 deletions

View File

@ -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,

View File

@ -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.

View File

@ -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<ret)
return(eret);
return(ret);
}
/* Option -cpr alias -cpri */
int Xorriso_option_cpri(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag)
@ -6740,7 +6756,7 @@ int Xorriso_option_eject(struct XorrisO *xorriso, char *which, int flag)
}
/* Option -end */
/* Options -end , and -rollback_end */
/* @param flag bit0= discard pending changes */
int Xorriso_option_end(struct XorrisO *xorriso, int flag)
{
@ -7179,6 +7195,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -commit Perform the write operation and then perform -dev outdrive.",
" Hint: To perform a final write operation with no new -dev",
" and no new loading of image, execute option -end.",
" -commit_eject Like -commit but rather eject than load image from outdrive.",
"",
" -close \"on\"|\"off\"",
" If \"on\" then mark the written media as not appendable.",
" -dummy \"on\"|\"off\"",
@ -8421,6 +8439,9 @@ next_command:;
} else if(strcmp(cmd,"commit")==0) {
ret= Xorriso_option_commit(xorriso, 0);
} else if(strcmp(cmd,"commit_eject")==0) {
ret= Xorriso_option_commit_eject(xorriso, 0);
} else if(strcmp(cmd,"cpr")==0 || strcmp(cmd,"cpri")==0) {
ret= Xorriso_option_cpri(xorriso, argc, argv, idx, 0);

View File

@ -203,6 +203,9 @@ int Xorriso_option_close(struct XorrisO *xorriso, char *mode, int flag);
/* @param flag bit0= do not aquire outdrive as new indrive */
int Xorriso_option_commit(struct XorrisO *xorriso, int flag);
/* Option -commit_eject */
int Xorriso_option_commit_eject(struct XorrisO *xorriso, int flag);
/* Option -cpr alias -cpri */
int Xorriso_option_cpri( struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag);
@ -230,7 +233,7 @@ int Xorriso_option_dummy(struct XorrisO *xorriso, char *mode, int flag);
/* Option -eject */
int Xorriso_option_eject(struct XorrisO *xorriso, char *which, int flag);
/* Option -end */
/* Options -end , and -rollback_end */
/* @param flag bit0= discard pending changes */
int Xorriso_option_end(struct XorrisO *xorriso, int flag);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.01.25.150902"
#define Xorriso_timestamP "2008.01.25.175353"