New -as mkisofs options -root , -old-root, --old-root-no-md5, --old-root-no-ino, --old-root-dev
This commit is contained in:
@ -1472,36 +1472,19 @@ int Xorriso_ls_filev(struct XorrisO *xorriso, char *wd,
|
||||
*/
|
||||
int Xorriso_ls(struct XorrisO *xorriso, int flag)
|
||||
{
|
||||
int ret, is_dir= 0, i, filec= 0, failed_at, no_sort= 0;
|
||||
int ret, i, filec= 0, failed_at, no_sort= 0;
|
||||
IsoNode *node, **node_array= NULL;
|
||||
IsoDir *dir_node;
|
||||
IsoImage *volume;
|
||||
IsoDirIter *iter= NULL;
|
||||
char sfe[5*SfileadrL], sfe2[5*SfileadrL], link_target[SfileadrL], *npt, *rpt;
|
||||
struct stat stbuf;
|
||||
|
||||
rpt= xorriso->result_line;
|
||||
|
||||
ret= Xorriso_get_volume(xorriso, &volume, 0);
|
||||
if(ret<=0)
|
||||
return(ret);
|
||||
|
||||
ret= Xorriso_node_from_path(xorriso, volume, xorriso->wdi, &node, 0);
|
||||
if(ret<=0)
|
||||
goto wdi_is_not_a_dir;
|
||||
if(LIBISO_ISDIR(node))
|
||||
is_dir= 1;
|
||||
if(!is_dir) {
|
||||
wdi_is_not_a_dir:;
|
||||
sprintf(xorriso->info_text,
|
||||
"Working directory path does not lead to a directory in ISO image");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
ret= 0; goto ex;
|
||||
}
|
||||
if(flag&2)
|
||||
{ret= 1; goto ex;}
|
||||
|
||||
dir_node= (IsoDir *) node;
|
||||
ret= Xorriso_dir_from_path(xorriso, "Working directory", xorriso->wdi,
|
||||
&dir_node, 0);
|
||||
if(ret <= 0)
|
||||
goto ex;
|
||||
ret= iso_dir_get_children(dir_node, &iter);
|
||||
if(ret<0) {
|
||||
cannot_create_iter:;
|
||||
@ -2153,6 +2136,34 @@ int Xorriso_node_from_path(struct XorrisO *xorriso, IsoImage *volume,
|
||||
}
|
||||
|
||||
|
||||
int Xorriso_dir_from_path(struct XorrisO *xorriso, char *purpose,
|
||||
char *path, IsoDir **dir_node, int flag)
|
||||
{
|
||||
IsoImage *volume;
|
||||
IsoNode *node;
|
||||
int ret, is_dir= 0;
|
||||
|
||||
ret= Xorriso_get_volume(xorriso, &volume, 0);
|
||||
if(ret<=0)
|
||||
return(ret);
|
||||
|
||||
ret= Xorriso_node_from_path(xorriso, volume, path, &node, 0);
|
||||
if(ret<=0)
|
||||
goto wdi_is_not_a_dir;
|
||||
if(LIBISO_ISDIR(node))
|
||||
is_dir= 1;
|
||||
if(!is_dir) {
|
||||
wdi_is_not_a_dir:;
|
||||
sprintf(xorriso->info_text,
|
||||
"%s path does not lead to a directory in ISO image", purpose);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
*dir_node= (IsoDir *) node;
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@param flag bit0= do not remove leading slash
|
||||
bit1= append flatly to result_line and put out
|
||||
|
Reference in New Issue
Block a user