New command -drive_access, new -as cdrecord option --drive_not_exclusive
This commit is contained in:
@ -257,6 +257,43 @@ int Xorriso_option_displacement(struct XorrisO *xorriso, char *value, int flag)
|
||||
}
|
||||
|
||||
|
||||
/* Command -drive_access "exclusive"|"shared":"readonly"|"unrestricted" */
|
||||
int Xorriso_option_drive_access(struct XorrisO *xorriso, char *mode, int flag)
|
||||
{
|
||||
int l;
|
||||
char *npt, *cpt;
|
||||
|
||||
npt= cpt= mode;
|
||||
for(cpt= mode; npt != NULL; cpt= npt+1) {
|
||||
npt= strchr(cpt, ':');
|
||||
if(npt==NULL)
|
||||
l= strlen(cpt);
|
||||
else
|
||||
l= npt - cpt;
|
||||
if(l == 0 && mode[0] != 0)
|
||||
goto unknown_mode;
|
||||
if(strncmp(cpt, "shared", l) == 0 && l == 6) {
|
||||
xorriso->drives_exclusive= 0;
|
||||
} else if(strncmp(cpt, "exclusive", l) == 0 && l == 9) {
|
||||
xorriso->drives_exclusive= 1;
|
||||
} else if(strncmp(cpt, "readonly", l) == 0 && l == 8) {
|
||||
xorriso->drives_access= 0;
|
||||
} else if(strncmp(cpt, "unrestricted", l) == 0 && l == 12) {
|
||||
xorriso->drives_access= 1;
|
||||
} else {
|
||||
unknown_mode:;
|
||||
sprintf(xorriso->info_text, "-drive_access: unknown mode '");
|
||||
if(l > 0 && l < SfileadrL)
|
||||
strncat(xorriso->info_text, cpt, l);
|
||||
strcat(xorriso->info_text, "'");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
/* Option -drive_class */
|
||||
int Xorriso_option_drive_class(struct XorrisO *xorriso,
|
||||
char *d_class, char *pattern, int flag)
|
||||
@ -1737,13 +1774,16 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
|
||||
" -drive_class \"harmless\"|\"banned\"|\"risky\"|\"clear_list\" disk_pattern",
|
||||
" Add a drive path pattern to one of the safety lists or make",
|
||||
" those lists empty. Defaulty entry in \"risky\" is \"/dev\".",
|
||||
" -grow_blindly \"off\"|predicted_nwa",
|
||||
" Switch between modifying and blind growing.",
|
||||
" -drive_access \"exclusive\"|\"shared\":\"unrestricted\"|\"readonly\"",
|
||||
" Enable or disable device file locking mechanisms.",
|
||||
" Enable or disable status and content changes of drive.",
|
||||
" -scsi_dev_family \"default\"|\"sr\"|\"scd\"|\"sg\"",
|
||||
" Linux specific: Choose device file type.",
|
||||
" -read_speed number[\"k/s\"|\"m/s\"|\"[x]CD\"|\"[x]DVD\"|\"[x]BD\"]",
|
||||
" Set the read speed. Default is \"none\" = do not set speed",
|
||||
" before reading.",
|
||||
" -grow_blindly \"off\"|predicted_nwa",
|
||||
" Switch between modifying and blind growing.",
|
||||
" -load \"session\"|\"track\"|\"lba\"|\"sbsector\"|\"volid\"|\"auto\" id",
|
||||
" Load a particular (outdated) ISO session from a -dev or",
|
||||
" -indev which hosts more than one session.",
|
||||
|
Reference in New Issue
Block a user