Sketched split file scheme with partno,totalparts,offset,count,totalsize
This commit is contained in:
@ -4240,6 +4240,7 @@ much_too_long:;
|
||||
bit14= early eof of iso file
|
||||
bit15= content bytes differ
|
||||
bit16= symbolic link on disk pointing to dir, dir in iso
|
||||
>>> bit17= file chunks detected and compared
|
||||
@param flag bit0= compare atime
|
||||
bit1= compare ctime
|
||||
bit2= check only existence of both file objects
|
||||
@ -4255,7 +4256,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
|
||||
int *result, int flag)
|
||||
{
|
||||
struct stat s1, s2, stbuf;
|
||||
int ret, r1, r2, fd1= -1, i, done, wanted, missing= 0;
|
||||
int ret, r1, r2, fd1= -1, i, done, wanted, missing= 0, is_split= 0;
|
||||
void *stream2= NULL;
|
||||
char *respt;
|
||||
char buf1[32*1024], buf2[32*1024], a[5*SfileadrL], sfe[5*SfileadrL];
|
||||
@ -4301,6 +4302,17 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
|
||||
|
||||
/* Attributes */
|
||||
if(s1.st_mode != s2.st_mode) {
|
||||
|
||||
if((S_ISREG(s1.st_mode) || S_ISBLK(s1.st_mode)) && S_ISDIR(s2.st_mode)) {
|
||||
|
||||
/* >>> SPLIT */
|
||||
/* >>> check whether there are only part_files in the directory */;
|
||||
/* >>> is_split= 1; */;
|
||||
/* >>> count this as content chunk container */;
|
||||
/* >>> compare access permissions of first chunk */;
|
||||
|
||||
}
|
||||
|
||||
if((s1.st_mode&~S_IFMT)!=(s2.st_mode&~S_IFMT)) {
|
||||
sprintf(respt, "%s st_mode : %7.7o <> %7.7o\n",
|
||||
a, s1.st_mode, s2.st_mode);
|
||||
@ -4405,8 +4417,15 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
|
||||
(*result)|= 4096;
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
if(is_split) {
|
||||
/* >>> SPLIT */
|
||||
/* >>> for each chunk file : do content comparison */;
|
||||
}
|
||||
|
||||
/* Content */
|
||||
/* >>> SPLIT */
|
||||
/* <<< outsource this as separate content comparison function */
|
||||
done= 0;
|
||||
while(!done) {
|
||||
/* fd1 is a regular file and should deliver full buffers */
|
||||
@ -4508,6 +4527,7 @@ I thought to have seen a libisofs bug here but it seems that it was an illusion
|
||||
@param flag bit0= update rather than compare
|
||||
bit1= find[ix] is in recursion
|
||||
@return <=0 error, 1= ok , 2= iso_path was deleted
|
||||
3=ok, do not dive into directory (e.g. because it is a split file)
|
||||
*/
|
||||
int Xorriso_find_compare(struct XorrisO *xorriso, void *boss_iter,
|
||||
char *iso_path, char *iso_prefix, char *disk_prefix,
|
||||
@ -4549,6 +4569,8 @@ int Xorriso_find_compare(struct XorrisO *xorriso, void *boss_iter,
|
||||
return(ret);
|
||||
if(deleted)
|
||||
return(2);
|
||||
if(result&(1<<17))
|
||||
return(3);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
@ -7155,6 +7177,9 @@ int Xorriso_update_interpreter(struct XorrisO *xorriso, void *boss_iter,
|
||||
|
||||
if(compare_result&(8|64)) {
|
||||
/* file type, minor+major with device file */
|
||||
|
||||
/* <<< SPLIT : cannot happen here */
|
||||
|
||||
ret= Xorriso_rmi(xorriso, boss_iter, (off_t) 0, iso_rr_path, 1); /* rm_r */
|
||||
if(ret>0) {
|
||||
deleted= 1;
|
||||
@ -7165,6 +7190,10 @@ int Xorriso_update_interpreter(struct XorrisO *xorriso, void *boss_iter,
|
||||
|
||||
} else if(compare_result&(1)) {
|
||||
/* disk_adr not existing */
|
||||
|
||||
/* ??? SPLIT : Shall i recognize a splitfile without disk file ?
|
||||
*/
|
||||
|
||||
ret= Xorriso_rmi(xorriso, boss_iter, (off_t) 0, iso_rr_path, 1);
|
||||
deleted= 1;
|
||||
sprintf(xorriso->info_text, "Deleted ");
|
||||
@ -7172,12 +7201,20 @@ int Xorriso_update_interpreter(struct XorrisO *xorriso, void *boss_iter,
|
||||
} else if(compare_result&(2|128|(1<<12)|(1<<14)|(1<<15))) {
|
||||
/* iso_adr not existing, size, cannot open iso file, early eof of iso file
|
||||
content bytes differ */
|
||||
|
||||
/* >>> SPLIT : differing content or size */
|
||||
/* >>> overwrite all parts in the directory */
|
||||
|
||||
ret= Xorriso_graft_in(xorriso, boss_iter, disk_path, iso_rr_path,
|
||||
(off_t) 0, (off_t) 0, 2|(flag&4));
|
||||
sprintf(xorriso->info_text, "Added/overwrote ");
|
||||
|
||||
} else if(compare_result&(4|16|32|256|512|1024)) {
|
||||
/* access permissions, user id, group id, mtime, atime, ctime */
|
||||
|
||||
/* >>> SPLIT : differing content or size */
|
||||
/* >>> renew attributes of all parts in the directory */
|
||||
|
||||
ret= Xorriso_copy_properties(xorriso, disk_path, iso_rr_path, 0);
|
||||
sprintf(xorriso->info_text, "Adjusted attributes of ");
|
||||
|
||||
@ -8078,6 +8115,11 @@ ex:;
|
||||
}
|
||||
|
||||
|
||||
/* >>> SPLIT : proposed target format
|
||||
|
||||
part_{partno}_of_{total_parts}_at_{offset}_with_{bytes}_of_{total_bytes}
|
||||
*/
|
||||
|
||||
/* Option -cut_out */
|
||||
int Xorriso_option_cut_out(struct XorrisO *xorriso, char *disk_path,
|
||||
char *start, char *count, char *iso_rr_path, int flag)
|
||||
|
Reference in New Issue
Block a user