Restricted split part recognition to directories with a complete part set

This commit is contained in:
Thomas Schmitt 2009-09-28 17:32:27 +00:00
parent 3adb23071f
commit 9f26cadda4
3 changed files with 41 additions and 54 deletions

View File

@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps .\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1) .\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Sep 25, 2009" .TH XORRISO 1 "Sep 27, 2009"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.\" Some roff macros, for reference: .\" Some roff macros, for reference:
@ -152,10 +152,8 @@ not altered. Pending alteration can be revoked by command -rollback.
Writing a session to the target is supposed to be very expensive in terms of Writing a session to the target is supposed to be very expensive in terms of
time and of consumed space on appendable or write-once media. Therefore all time and of consumed space on appendable or write-once media. Therefore all
intended manipulations of a particular ISO image should be done in a single intended manipulations of a particular ISO image should be done in a single
session. session. But in principle it is possible
.br to store intermediate states and to continue with image manipulations.
In some special situations (e.g. in a file-to-file situation) it can be
useful to store intermediate states and to continue with image manipulations.
.SS .SS
.B Media types and states: .B Media types and states:
There are two families of media in the MMC standard: There are two families of media in the MMC standard:
@ -173,9 +171,8 @@ be emulated. Else only a single overall session will be visible.
DVD-RW media can be formatted by -format full. DVD-RW media can be formatted by -format full.
They can be made unformatted by -blank deformat. They can be made unformatted by -blank deformat.
.br .br
Emulated drives are handled as overwriteable media if they are random Regular files and block devices are handled as overwriteable media.
read-write accessible. If they are only sequentially writeable then Pipes and other writeable file types are handled as blank multi-session media.
they are handled as blank multi-session media.
.PP .PP
These media can assume several states in which they offer different These media can assume several states in which they offer different
capabilities. capabilities.
@ -188,7 +185,7 @@ With used CD-RW and DVD-RW it can be achieved by action -blank "as_needed".
Overwriteable media are considered blank if they are new or if they have Overwriteable media are considered blank if they are new or if they have
been marked as blank by xorriso. been marked as blank by xorriso.
Action -blank "as_needed" can be used to do this marking on overwriteable Action -blank "as_needed" can be used to do this marking on overwriteable
media, or to apply eventual mandatory formatting of new media. media, or to apply eventual mandatory formatting to new media.
.br .br
\fBAppendable\fR media accept further sessions. Either they are MMC \fBAppendable\fR media accept further sessions. Either they are MMC
multi-session media in appendable state, or they are overwriteable media multi-session media in appendable state, or they are overwriteable media
@ -405,6 +402,7 @@ according to entry "group::". xorriso brings "group::" into effect before
eventually removing the ACL from a file. eventually removing the ACL from a file.
.PP .PP
.B xattr .B xattr
(aka EA)
are pairs of name and value which can be attached to file objects. AAIP is are pairs of name and value which can be attached to file objects. AAIP is
able to represent them and xorriso allows to record and restore pairs which able to represent them and xorriso allows to record and restore pairs which
have names out of the user namespace. I.e. those which begin with "user.", have names out of the user namespace. I.e. those which begin with "user.",
@ -414,7 +412,8 @@ xattr processing happens only if it is enabled by option
.B -xattr. .B -xattr.
.br .br
As with ACL, currently only xorriso is able to retrieve xattr from AAIP As with ACL, currently only xorriso is able to retrieve xattr from AAIP
enhanced images and to restore them to xattr capable file systems. enhanced images, to restore them to xattr capable file systems, or to print
them.
.SS .SS
.B Command processing: .B Command processing:
.br .br
@ -994,10 +993,11 @@ E.g:
.br .br
/file/part_3_of_3_at_4094m_with_2047m_of_5753194821 /file/part_3_of_3_at_4094m_with_2047m_of_5753194821
.br .br
While option -split_size is set larger than 0 such file pieces will be While option -split_size is set larger than 0, and if all pieces of a file
recognized by their peculiar names. They get handled by options -compare* and reside in the same ISO directory with no other files, and if the names look
-update*. In overwrite situations the common parent directory will be handled like above, then their ISO directory will be recognized and handled like a
like a regular file, if it contains exactly one complete set of file parts. regular file. This affects options -compare*, -update*, and overwrite
situations.
See option -split_size for details. See option -split_size for details.
.TP .TP
\fB\-cpr\fR disk_path [***] iso_rr_path \fB\-cpr\fR disk_path [***] iso_rr_path
@ -1793,17 +1793,14 @@ FAILURE event.
A well tested -split_size is 2047m. Sizes above -file_size_limit are not A well tested -split_size is 2047m. Sizes above -file_size_limit are not
permissible. permissible.
.br .br
While option -split_size is set larger than 0 such file pieces will be While option -split_size is set larger than 0 such a directory with split
recognized and handled by options -compare* and -update*. In overwrite file pieces will be recognized and handled like a regular file by options
situations, the common parent directory will be handled like a regular file -compare* , -update*, and in overwrite situations. There are -ossirox
if it contains only one complete set of file parts. options "concat_split_on" and "concat_split_off" which control the handling
when files get restored to disk.
.br .br
In order to be recognizable, the names of the part files have to follow In order to be recognizable, the names of the part files have to
a convention: describe the splitting by 5 numbers:
.br
A disk file gets mapped to an ISO directory containing its split parts
as regular files. The parts have names which describe the splitting
by 5 numbers
.br .br
part_number,total_parts,byte_offset,byte_count,disk_file_size part_number,total_parts,byte_offset,byte_count,disk_file_size
.br .br
@ -1816,16 +1813,9 @@ All digits are interpreted as decimal, even if leading zeros are present.
.br .br
E.g: /file/part_1_of_3_at_0_with_2047m_of_5753194821 E.g: /file/part_1_of_3_at_0_with_2047m_of_5753194821
.br .br
For -update* and -compar* not all parts have to be present on the same media. No other files are allowed in the directory. All parts have to be present and
But those parts which are present have to sit in the same directory. their numbers have to be plausible. E.g. byte_count must be valid as -cut_out
No other files are allowed in there. Parts have to be disjoint. Their numbers argument and their contents may not overlap.
have to be plausible. E.g. byte_count must be valid as -cut_out argument
and it must be the same with all parts.
.br
If the disk file grows enough to need new parts then those get added
to the directory if it already contains all parts of the old disk file.
If not all parts are present, then only those present parts will
be updated.
.TP .TP
.B Settings for result writing: .B Settings for result writing:
.TP .TP
@ -3630,7 +3620,7 @@ The default setting of -check_media abort_file= is:
.br .br
.SH SEE ALSO .SH SEE ALSO
.TP .TP
For mounting xorriso generated ISO 9660 images For mounting xorriso generated ISO 9660 images (-t iso9660)
.br .br
.BR mount(8) .BR mount(8)
.TP .TP

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.09.27.080401" #define Xorriso_timestamP "2009.09.28.173322"

View File

@ -8026,6 +8026,8 @@ int Xorriso_findi_test(struct XorrisO *xorriso, struct FindjoB *job,
/* @param flag bit0= recursion /* @param flag bit0= recursion
bit1= do not count deleted files with rm and rm_r bit1= do not count deleted files with rm and rm_r
bit2= do not dive into split file directories
(implicitly given with actions 14=compare and 17=update)
@return <=0 error, 1= ok , 2= dir node and path has been deleted @return <=0 error, 1= ok , 2= dir node and path has been deleted
*/ */
int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job, int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
@ -8033,7 +8035,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, no_dive= 0, split_flag; 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;
@ -8128,11 +8130,9 @@ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
} }
if(no_dive || !LIBISO_ISDIR((IsoNode *) dir_node)) if(no_dive || !LIBISO_ISDIR((IsoNode *) dir_node))
{ret= 1; goto ex;} {ret= 1; goto ex;}
split_flag= 1 | 2; if(action == 14 || action == 17 || (flag & 4))
if(action == 14 || action == 17) if(Xorriso_is_split(xorriso, dir_path, (IsoNode *) dir_node, 1)>0)
split_flag &= ~2; {ret= 1; goto ex;}
if(Xorriso_is_split(xorriso, dir_path, (IsoNode *) dir_node, split_flag)>0)
{ret= 1; goto ex;}
mem= boss_mem; mem= boss_mem;
hflag= 1; hflag= 1;
@ -8354,7 +8354,7 @@ int Xorriso_path_from_lba(struct XorrisO *xorriso, IsoNode *node, int lba,
int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job, int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job,
off_t boss_mem, int filec, char **filev, int flag) off_t boss_mem, int filec, char **filev, int flag)
{ {
int i, ret; int i, ret, find_flag= 0;
struct FindjoB array_job, *proxy_job= NULL, *hindmost= NULL, *hmboss= NULL; struct FindjoB array_job, *proxy_job= NULL, *hindmost= NULL, *hmboss= NULL;
struct stat dir_stbuf; struct stat dir_stbuf;
IsoNode *node; IsoNode *node;
@ -8363,6 +8363,8 @@ int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job,
array_job.start_path= NULL; array_job.start_path= NULL;
if(job->action == 14 || job->action == 17)
find_flag|= 4;
if(job->action>=9 && job->action<=13) { /* actions which have own findjobs */ if(job->action>=9 && job->action<=13) { /* actions which have own findjobs */
/* array_job replaces the hindmost job in the chain */ /* array_job replaces the hindmost job in the chain */
for(hindmost= job; hindmost->subjob != NULL; hindmost= hindmost->subjob) for(hindmost= job; hindmost->subjob != NULL; hindmost= hindmost->subjob)
@ -8391,7 +8393,7 @@ int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job,
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
ret= Xorriso_findi(xorriso, proxy_job, NULL, boss_mem, NULL, ret= Xorriso_findi(xorriso, proxy_job, NULL, boss_mem, NULL,
filev[i], &dir_stbuf, 0, 0); filev[i], &dir_stbuf, 0, find_flag);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
} }
@ -8410,7 +8412,7 @@ int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job,
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
ret= Xorriso_findi(xorriso, job, NULL, boss_mem, NULL, ret= Xorriso_findi(xorriso, job, NULL, boss_mem, NULL,
filev[i], &dir_stbuf, 0, 0); filev[i], &dir_stbuf, 0, find_flag);
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;
@ -8440,7 +8442,7 @@ int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job,
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
ret= Xorriso_findi(xorriso, proxy_job, NULL, mem_needed, NULL, ret= Xorriso_findi(xorriso, proxy_job, NULL, mem_needed, NULL,
filev[i], &dir_stbuf, 0, 0); filev[i], &dir_stbuf, 0, find_flag);
if(ret <= 0) if(ret <= 0)
goto ex; goto ex;
} }
@ -9238,8 +9240,7 @@ int Xorriso_iso_file_close(struct XorrisO *xorriso, void **stream, int flag)
/* @param flag bit0= in_node is valid, do not resolve iso_adr /* @param flag bit0= in_node is valid, do not resolve iso_adr
bit1= insist in complete collection of part files bit2= recognize and parse split parts despite
??? <<< bit2= recognize and parse split parts despite
xorrio->split_size <= 0 xorrio->split_size <= 0
*/ */
int Xorriso_identify_split(struct XorrisO *xorriso, char *iso_adr, int Xorriso_identify_split(struct XorrisO *xorriso, char *iso_adr,
@ -9262,10 +9263,6 @@ int Xorriso_identify_split(struct XorrisO *xorriso, char *iso_adr,
*count= 0; *count= 0;
*parts= NULL; *parts= NULL;
/* <<< remove bit1 and hardcode it
flag|= 2;
*/
if(xorriso->split_size <= 0 && !(flag & 4)) if(xorriso->split_size <= 0 && !(flag & 4))
return(0); return(0);
@ -9323,7 +9320,7 @@ cannot_iter:;
{ret= 0; goto ex;} {ret= 0; goto ex;}
(*count)++; (*count)++;
} }
if(*count <= 0 || (*count != first_total_parts && (flag & 2))) if(*count <= 0 || *count != first_total_parts)
{ret= 0; goto ex;} {ret= 0; goto ex;}
ret= Splitparts_new(parts, (*count)+1, 0); /* (have one end marker item) */ ret= Splitparts_new(parts, (*count)+1, 0); /* (have one end marker item) */
@ -9366,7 +9363,7 @@ cannot_iter:;
incomplete= 1; incomplete= 1;
memcpy(total_stbuf, &first_stbuf, sizeof(struct stat)); memcpy(total_stbuf, &first_stbuf, sizeof(struct stat));
total_stbuf->st_size= total_bytes; total_stbuf->st_size= total_bytes;
ret= !(overlapping || ((flag&2)&&incomplete)); ret= !(overlapping || incomplete);
ex:; ex:;
if(iter!=NULL) if(iter!=NULL)
iso_dir_iter_free(iter); iso_dir_iter_free(iter);