Sketched split file scheme with partno,totalparts,offset,count,totalsize
This commit is contained in:
parent
358b159b83
commit
47eb5a285e
@ -4240,6 +4240,7 @@ much_too_long:;
|
|||||||
bit14= early eof of iso file
|
bit14= early eof of iso file
|
||||||
bit15= content bytes differ
|
bit15= content bytes differ
|
||||||
bit16= symbolic link on disk pointing to dir, dir in iso
|
bit16= symbolic link on disk pointing to dir, dir in iso
|
||||||
|
>>> bit17= file chunks detected and compared
|
||||||
@param flag bit0= compare atime
|
@param flag bit0= compare atime
|
||||||
bit1= compare ctime
|
bit1= compare ctime
|
||||||
bit2= check only existence of both file objects
|
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)
|
int *result, int flag)
|
||||||
{
|
{
|
||||||
struct stat s1, s2, stbuf;
|
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;
|
void *stream2= NULL;
|
||||||
char *respt;
|
char *respt;
|
||||||
char buf1[32*1024], buf2[32*1024], a[5*SfileadrL], sfe[5*SfileadrL];
|
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 */
|
/* Attributes */
|
||||||
if(s1.st_mode != s2.st_mode) {
|
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)) {
|
if((s1.st_mode&~S_IFMT)!=(s2.st_mode&~S_IFMT)) {
|
||||||
sprintf(respt, "%s st_mode : %7.7o <> %7.7o\n",
|
sprintf(respt, "%s st_mode : %7.7o <> %7.7o\n",
|
||||||
a, s1.st_mode, s2.st_mode);
|
a, s1.st_mode, s2.st_mode);
|
||||||
@ -4406,7 +4418,14 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(is_split) {
|
||||||
|
/* >>> SPLIT */
|
||||||
|
/* >>> for each chunk file : do content comparison */;
|
||||||
|
}
|
||||||
|
|
||||||
/* Content */
|
/* Content */
|
||||||
|
/* >>> SPLIT */
|
||||||
|
/* <<< outsource this as separate content comparison function */
|
||||||
done= 0;
|
done= 0;
|
||||||
while(!done) {
|
while(!done) {
|
||||||
/* fd1 is a regular file and should deliver full buffers */
|
/* 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
|
@param flag bit0= update rather than compare
|
||||||
bit1= find[ix] is in recursion
|
bit1= find[ix] is in recursion
|
||||||
@return <=0 error, 1= ok , 2= iso_path was deleted
|
@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,
|
int Xorriso_find_compare(struct XorrisO *xorriso, void *boss_iter,
|
||||||
char *iso_path, char *iso_prefix, char *disk_prefix,
|
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);
|
return(ret);
|
||||||
if(deleted)
|
if(deleted)
|
||||||
return(2);
|
return(2);
|
||||||
|
if(result&(1<<17))
|
||||||
|
return(3);
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7155,6 +7177,9 @@ int Xorriso_update_interpreter(struct XorrisO *xorriso, void *boss_iter,
|
|||||||
|
|
||||||
if(compare_result&(8|64)) {
|
if(compare_result&(8|64)) {
|
||||||
/* file type, minor+major with device file */
|
/* 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 */
|
ret= Xorriso_rmi(xorriso, boss_iter, (off_t) 0, iso_rr_path, 1); /* rm_r */
|
||||||
if(ret>0) {
|
if(ret>0) {
|
||||||
deleted= 1;
|
deleted= 1;
|
||||||
@ -7165,6 +7190,10 @@ int Xorriso_update_interpreter(struct XorrisO *xorriso, void *boss_iter,
|
|||||||
|
|
||||||
} else if(compare_result&(1)) {
|
} else if(compare_result&(1)) {
|
||||||
/* disk_adr not existing */
|
/* 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);
|
ret= Xorriso_rmi(xorriso, boss_iter, (off_t) 0, iso_rr_path, 1);
|
||||||
deleted= 1;
|
deleted= 1;
|
||||||
sprintf(xorriso->info_text, "Deleted ");
|
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))) {
|
} 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
|
/* iso_adr not existing, size, cannot open iso file, early eof of iso file
|
||||||
content bytes differ */
|
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,
|
ret= Xorriso_graft_in(xorriso, boss_iter, disk_path, iso_rr_path,
|
||||||
(off_t) 0, (off_t) 0, 2|(flag&4));
|
(off_t) 0, (off_t) 0, 2|(flag&4));
|
||||||
sprintf(xorriso->info_text, "Added/overwrote ");
|
sprintf(xorriso->info_text, "Added/overwrote ");
|
||||||
|
|
||||||
} else if(compare_result&(4|16|32|256|512|1024)) {
|
} else if(compare_result&(4|16|32|256|512|1024)) {
|
||||||
/* access permissions, user id, group id, mtime, atime, ctime */
|
/* 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);
|
ret= Xorriso_copy_properties(xorriso, disk_path, iso_rr_path, 0);
|
||||||
sprintf(xorriso->info_text, "Adjusted attributes of ");
|
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 */
|
/* Option -cut_out */
|
||||||
int Xorriso_option_cut_out(struct XorrisO *xorriso, char *disk_path,
|
int Xorriso_option_cut_out(struct XorrisO *xorriso, char *disk_path,
|
||||||
char *start, char *count, char *iso_rr_path, int flag)
|
char *start, char *count, char *iso_rr_path, int flag)
|
||||||
|
@ -1 +1 @@
|
|||||||
#define Xorriso_timestamP "2008.03.09.211041"
|
#define Xorriso_timestamP "2008.03.11.113444"
|
||||||
|
@ -4107,14 +4107,17 @@ int Xorriso_set_time(struct XorrisO *xorriso, char *in_path, time_t t,
|
|||||||
|
|
||||||
/* @param flag bit0= not a command parameter (directory iteration or recursion)
|
/* @param flag bit0= not a command parameter (directory iteration or recursion)
|
||||||
bit1= do not count deleted files with rm and rm_r
|
bit1= do not count deleted files with rm and rm_r
|
||||||
@return <=0 error, 1=ok, 2=ok, node has been deleted
|
@return <=0 error,
|
||||||
|
1=ok
|
||||||
|
2=ok, node has been deleted,
|
||||||
|
3=ok, do not dive into directory (e.g. because it is a split file)
|
||||||
*/
|
*/
|
||||||
int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
|
int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
|
||||||
IsoDirIter *boss_iter, off_t boss_mem,
|
IsoDirIter *boss_iter, off_t boss_mem,
|
||||||
char *abs_path, char *show_path,
|
char *abs_path, char *show_path,
|
||||||
IsoNode *node, int depth, int flag)
|
IsoNode *node, int depth, int flag)
|
||||||
{
|
{
|
||||||
int ret= 0, type, action= 0, hflag, deleted= 0;
|
int ret= 0, type, action= 0, hflag, deleted= 0, no_dive= 0;
|
||||||
uid_t user= 0;
|
uid_t user= 0;
|
||||||
gid_t group= 0;
|
gid_t group= 0;
|
||||||
time_t date= 0;
|
time_t date= 0;
|
||||||
@ -4164,6 +4167,8 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
|
|||||||
iso_prefix, target, (action==17)|((flag&1)<<1));
|
iso_prefix, target, (action==17)|((flag&1)<<1));
|
||||||
if(ret==2)
|
if(ret==2)
|
||||||
deleted= 1;
|
deleted= 1;
|
||||||
|
if(ret==3)
|
||||||
|
no_dive= 1;
|
||||||
if(ret>=0)
|
if(ret>=0)
|
||||||
ret= 1;
|
ret= 1;
|
||||||
} else if(action==16 || action==18) { /* not_in_iso , add_missing */
|
} else if(action==16 || action==18) { /* not_in_iso , add_missing */
|
||||||
@ -4177,6 +4182,8 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
|
|||||||
return(ret);
|
return(ret);
|
||||||
if(deleted)
|
if(deleted)
|
||||||
return(2);
|
return(2);
|
||||||
|
if(no_dive)
|
||||||
|
return(3);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4190,7 +4197,7 @@ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
|
|||||||
void *dir_node_generic, char *dir_path,
|
void *dir_node_generic, char *dir_path,
|
||||||
struct stat *dir_stbuf, int depth, int flag)
|
struct stat *dir_stbuf, int depth, int flag)
|
||||||
{
|
{
|
||||||
int ret, action= 0, hflag, deleted= 0;
|
int ret, action= 0, hflag, deleted= 0, no_dive= 0;
|
||||||
IsoDirIter *iter= NULL;
|
IsoDirIter *iter= NULL;
|
||||||
IsoDir *dir_node= NULL;
|
IsoDir *dir_node= NULL;
|
||||||
IsoNode *node, *iso_node;
|
IsoNode *node, *iso_node;
|
||||||
@ -4253,9 +4260,11 @@ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
|
|||||||
deleted= 1;
|
deleted= 1;
|
||||||
goto ex;
|
goto ex;
|
||||||
}
|
}
|
||||||
|
if(ret==3)
|
||||||
|
no_dive= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!LIBISO_ISDIR((IsoNode *) dir_node))
|
if(no_dive || !LIBISO_ISDIR((IsoNode *) dir_node))
|
||||||
{ret= 1; goto ex;}
|
{ret= 1; goto ex;}
|
||||||
|
|
||||||
mem= boss_mem;
|
mem= boss_mem;
|
||||||
@ -4303,13 +4312,14 @@ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
|
|||||||
abs_path, path, node, depth, 1|(flag&2));
|
abs_path, path, node, depth, 1|(flag&2));
|
||||||
if(ret==2) /* node has been deleted */
|
if(ret==2) /* node has been deleted */
|
||||||
continue;
|
continue;
|
||||||
|
no_dive= (ret==3);
|
||||||
if(ret<=0) {
|
if(ret<=0) {
|
||||||
if(Xorriso_eval_problem_status(xorriso, ret, 1|2)<0)
|
if(Xorriso_eval_problem_status(xorriso, ret, 1|2)<0)
|
||||||
goto ex;
|
goto ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(S_ISDIR(stbuf.st_mode)) {
|
if(S_ISDIR(stbuf.st_mode) && !no_dive) {
|
||||||
ret= Xorriso_findi(xorriso, job, (void *) iter, mem,
|
ret= Xorriso_findi(xorriso, job, (void *) iter, mem,
|
||||||
(void *) node, path, &stbuf, depth+1, flag|1);
|
(void *) node, path, &stbuf, depth+1, flag|1);
|
||||||
if(ret<0)
|
if(ret<0)
|
||||||
|
Loading…
Reference in New Issue
Block a user