New action estimate_size for -find and -findx

This commit is contained in:
2010-12-02 11:10:39 +00:00
parent 65fdba8884
commit 025d6f2ee6
10 changed files with 121 additions and 40 deletions

View File

@ -1087,6 +1087,7 @@ int Xorriso_findx_action(struct XorrisO *xorriso, struct FindjoB *job,
time_t date= 0;
mode_t mode_or= 0, mode_and= ~1;
char *target, *text_2, sfe[5*SfileadrL], *disk_prefix, iso_path[SfileadrL];
char *basename;
struct FindjoB *subjob;
struct stat stbuf;
@ -1167,6 +1168,16 @@ int Xorriso_findx_action(struct XorrisO *xorriso, struct FindjoB *job,
Xorriso_result(xorriso,0);
}
{ret= 1; goto ex;}
} else if(action == 40) { /* estimate_size */
basename= strrchr(abs_path, '/');
if(basename != NULL)
basename++;
else
basename= abs_path;
ret= lstat(abs_path, &stbuf);
if(ret != -1)
ret= Xorriso_estimate_file_size(xorriso, job, basename, stbuf.st_mode,
stbuf.st_size, 0);
} else {
sprintf(xorriso->result_line, "%s\n", Text_shellsafe(show_path, sfe, 0));
Xorriso_result(xorriso, 0);