|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
|
|
|
|
|
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
|
|
|
|
|
|
|
|
|
|
Copyright 2007-2016 Thomas Schmitt, <scdbackup@gmx.net>
|
|
|
|
|
Copyright 2007-2019 Thomas Schmitt, <scdbackup@gmx.net>
|
|
|
|
|
|
|
|
|
|
Provided under GPL version 2 or later.
|
|
|
|
|
|
|
|
|
@ -1400,6 +1400,8 @@ int Xorriso_make_md5(struct XorrisO *xorriso, void *in_node, char *path,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* @param flag bit0= do not only sum up sizes but also print subdirs
|
|
|
|
|
|
|
|
|
|
bit2= do not report result by Xorriso_result()
|
|
|
|
|
*/
|
|
|
|
|
int Xorriso_show_du_subs(struct XorrisO *xorriso, IsoDir *dir_node,
|
|
|
|
|
char *abs_path, char *rel_path, off_t *size,
|
|
|
|
@ -1516,13 +1518,15 @@ much_too_long:;
|
|
|
|
|
report_size= sub_size/1024;
|
|
|
|
|
if(report_size*1024<sub_size)
|
|
|
|
|
report_size++;
|
|
|
|
|
if(xorriso->sh_style_result)
|
|
|
|
|
sprintf(xorriso->result_line, "%-7.f ",(double) (report_size));
|
|
|
|
|
else
|
|
|
|
|
sprintf(xorriso->result_line, "%7.f ",(double) (report_size));
|
|
|
|
|
sprintf(xorriso->result_line+strlen(xorriso->result_line), "%s\n",
|
|
|
|
|
Xorriso_esc_filepath(xorriso, show_path, sfe, 0));
|
|
|
|
|
Xorriso_result(xorriso, 0);
|
|
|
|
|
if(!(flag & 4)) {
|
|
|
|
|
if(xorriso->sh_style_result)
|
|
|
|
|
sprintf(xorriso->result_line, "%-7.f ",(double) (report_size));
|
|
|
|
|
else
|
|
|
|
|
sprintf(xorriso->result_line, "%7.f ",(double) (report_size));
|
|
|
|
|
sprintf(xorriso->result_line+strlen(xorriso->result_line), "%s\n",
|
|
|
|
|
Xorriso_esc_filepath(xorriso, show_path, sfe, 0));
|
|
|
|
|
Xorriso_result(xorriso, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ret= 1;
|
|
|
|
|
ex:;
|
|
|
|
@ -1844,6 +1848,41 @@ ex:;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
@return: <=0 = error, 1= directory tree, 2= path leads to non-directory
|
|
|
|
|
*/
|
|
|
|
|
int Xorriso_get_dus(struct XorrisO *xorriso, char *iso_rr_path, off_t *size,
|
|
|
|
|
off_t boss_mem, int flag)
|
|
|
|
|
{
|
|
|
|
|
int ret;
|
|
|
|
|
IsoNode *node;
|
|
|
|
|
char *path= NULL;
|
|
|
|
|
struct stat stbuf;
|
|
|
|
|
|
|
|
|
|
Xorriso_alloc_meM(path, char, SfileadrL);
|
|
|
|
|
|
|
|
|
|
ret= Xorriso_make_abs_adr(xorriso, xorriso->wdi, iso_rr_path, path,
|
|
|
|
|
1 | 2 | 4);
|
|
|
|
|
if(ret <= 0)
|
|
|
|
|
goto ex;
|
|
|
|
|
ret= Xorriso_fake_stbuf(xorriso, path, &stbuf, &node, 0);
|
|
|
|
|
if(ret <= 0)
|
|
|
|
|
goto ex;
|
|
|
|
|
if(!S_ISDIR(stbuf.st_mode)) {
|
|
|
|
|
*size= stbuf.st_size;
|
|
|
|
|
ret= 2; goto ex;
|
|
|
|
|
}
|
|
|
|
|
ret= Xorriso_show_du_subs(xorriso, (IsoDir *) node, path, iso_rr_path, size,
|
|
|
|
|
boss_mem, 4);
|
|
|
|
|
if(ret <= 0)
|
|
|
|
|
goto ex;
|
|
|
|
|
ret= 1;
|
|
|
|
|
ex:
|
|
|
|
|
Xorriso_free_meM(path);
|
|
|
|
|
return(ret);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* This function needs less buffer memory than Xorriso_ls_filev() but cannot
|
|
|
|
|
perform structured pattern matching as done by Xorriso_expand_pattern()
|
|
|
|
|
for subsequent Xorriso_ls_filev().
|
|
|
|
|