Displaying data file sizes with -update and -update_r

This commit is contained in:
Thomas Schmitt 2018-10-10 13:48:51 +02:00
parent 05732a210b
commit 1002df950d
2 changed files with 16 additions and 4 deletions

View File

@ -795,7 +795,7 @@ int Xorriso_update_interpreter(struct XorrisO *xorriso,
struct SplitparT *split_parts= NULL; struct SplitparT *split_parts= NULL;
int split_count= 0; int split_count= 0;
char *part_path= NULL, *part_name; char *part_path= NULL, *part_name;
int partno, total_parts, new_total_parts; int partno, total_parts, new_total_parts, added_overwrote= 0;
off_t offset, bytes, total_bytes, disk_size, first_bytes; off_t offset, bytes, total_bytes, disk_size, first_bytes;
if((compare_result&3)==3) { if((compare_result&3)==3) {
@ -959,10 +959,12 @@ overwrite:;
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
} }
if(flag & 1) if(flag & 1) {
sprintf(xorriso->info_text, "Widened hard link "); sprintf(xorriso->info_text, "Widened hard link ");
else } else {
sprintf(xorriso->info_text, "Added/overwrote "); sprintf(xorriso->info_text, "Added/overwrote ");
added_overwrote= 1;
}
} else if(compare_result&(4|16|32|256|512|1024|(1<<19)|(1<<20)|(1<<22))) { } else if(compare_result&(4|16|32|256|512|1024|(1<<19)|(1<<20)|(1<<22))) {
/* access permissions, user id, group id, mtime, atime, ctime, ACL, xattr, /* access permissions, user id, group id, mtime, atime, ctime, ACL, xattr,
@ -1005,6 +1007,16 @@ overwrite:;
ret= 1; ret= 1;
if(ret>0 && xorriso->info_text[0]) { if(ret>0 && xorriso->info_text[0]) {
Text_shellsafe(iso_rr_path, xorriso->info_text, 1); Text_shellsafe(iso_rr_path, xorriso->info_text, 1);
if(added_overwrote) {
ret= Xorriso_iso_lstat(xorriso, iso_rr_path, &stbuf, 0);
if(ret == 0 && S_ISREG(stbuf.st_mode)) {
strcat(xorriso->info_text, " (");
Sfile_scale((double) stbuf.st_size,
xorriso->info_text + strlen(xorriso->info_text), 5, 1e4,
1 | 2);
strcat(xorriso->info_text, ")");
}
}
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "UPDATE", 0);
} }
ret= 1; ret= 1;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2018.09.16.145527" #define Xorriso_timestamP "2018.10.10.114818"