New command -lns for creating symbolic links

This commit is contained in:
2012-10-19 08:19:02 +00:00
parent 47376c601f
commit 4678629282
10 changed files with 147 additions and 51 deletions

View File

@ -182,6 +182,38 @@ int Xorriso_option_list_profiles(struct XorrisO *xorriso, char *which,
}
/* Command -lns alias -lnsi */
int Xorriso_option_lnsi(struct XorrisO *xorriso, char *target, char *path,
int flag)
{
int ret;
char *eff_path= NULL;
Xorriso_alloc_meM(eff_path, char, SfileadrL);
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 1);
if(ret < 0)
{ret= 0; goto ex;}
if(ret > 0) {
sprintf(xorriso->info_text, "-lns: Address already existing: ");
Text_shellsafe(eff_path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, path, eff_path, 2);
if(ret < 0)
{ret= 0; goto ex;}
ret= Xorriso_graft_in(xorriso, NULL, target, eff_path, (off_t) 0, (off_t) 0,
1024);
if(ret <= 0)
{ret= 0; goto ex;}
ret= 1;
ex:;
Xorriso_free_meM(eff_path);
return(ret);
}
/* Option -load session|track|sbsector value */
/* @param flag bit0= with adr_mode sbsector: adr_value is possibly 16 too high
@return <=0 error , 1 success, 2 revoked by -reassure