New -find action "show_stream_id"

This commit is contained in:
Thomas Schmitt 2014-11-04 12:19:00 +00:00
parent abe480940f
commit 663ec2196a
8 changed files with 79 additions and 46 deletions

View File

@ -172,6 +172,7 @@ struct FindjoB {
49= internal: update creator, type, and blessings from persistent isofs.*
50= print_outname namespace
51= report_sections
52= show_stream_id
*/
int action;
int prune;

View File

@ -2610,8 +2610,8 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
target, strlen(text_2), text_2, 0);
} else if(action == 28) { /* set_filter */
ret= Xorriso_set_filter(xorriso, (void *) node, show_path, target, 1 | 2);
} else if(action == 29) { /* show_stream */
ret= Xorriso_show_stream(xorriso, (void *) node, show_path, 1 | 2);
} else if(action == 29 || action == 52) { /* show_stream , show_stream_id */
ret= Xorriso_show_stream(xorriso, (void *) node, show_path, (action == 52));
} else if(action == 30) { /* internal: count */
xorriso->node_counter++;
} else if(action == 31) { /* internal: register */

View File

@ -2220,6 +2220,8 @@ int Xorriso_retrieve_disk_path(struct XorrisO *xorriso, IsoNode *node,
}
/* @param flag bit0= show numbers from iso_stream_get_id
*/
int Xorriso_show_stream(struct XorrisO *xorriso, void *in_node,
char *path, int flag)
{
@ -2229,6 +2231,9 @@ int Xorriso_show_stream(struct XorrisO *xorriso, void *in_node,
IsoStream *stream= NULL, *input_stream;
IsoExternalFilterCommand *cmd;
char type_text[16], *source_path= NULL;
unsigned int fs_id;
dev_t dev_id;
ino_t ino_id;
node= (IsoNode *) in_node;
if(node == NULL) {
@ -2249,6 +2254,12 @@ int Xorriso_show_stream(struct XorrisO *xorriso, void *in_node,
strcat(xorriso->result_line, " < ");
Xorriso_stream_type(xorriso, node, stream, type_text, 0);
strcat(xorriso->result_line, type_text);
if(flag & 1) {
iso_stream_get_id(stream, &fs_id, &dev_id, &ino_id);
sprintf(xorriso->result_line + strlen(xorriso->result_line),
"[%u,%lu,%lu]", fs_id, (unsigned long) dev_id,
(unsigned long) ino_id);
}
ret= iso_stream_get_external_filter(stream, &cmd, 0);
if(ret < 0) {
Xorriso_process_msg_queues(xorriso,0);
@ -2268,6 +2279,11 @@ int Xorriso_show_stream(struct XorrisO *xorriso, void *in_node,
strcat(xorriso->result_line, " < ");
Xorriso_stream_type(xorriso, node, stream, type_text, 0);
strcat(xorriso->result_line, type_text);
if(flag & 1) {
iso_stream_get_id(stream, &fs_id, &dev_id, &ino_id);
sprintf(xorriso->result_line + strlen(xorriso->result_line), "[%u,%lu,%lu]",
fs_id, (unsigned long) dev_id, (unsigned long) ino_id);
}
source_path= iso_stream_get_source_path(stream, 0);
if(source_path != NULL) {

View File

@ -770,6 +770,8 @@ not_enough_arguments:;
if(i+2>=end_idx)
goto not_enough_arguments;
i+= 2;
/* >>> if letter suffix: use Scanf_io_size */
sscanf(argv[i-1], "%d", &start_lba);
sscanf(argv[i], "%d", &count);
Findjob_set_lba_range(job, start_lba, count, 0);
@ -1225,6 +1227,8 @@ not_enough_exec_arguments:;
Findjob_set_action_type(job, 50, name_space, 0);
} else if(strcmp(cpt, "report_sections")==0) {
Findjob_set_action_target(job, 51, NULL, 0);
} else if(strcmp(cpt, "show_stream_id") == 0) {
Findjob_set_action_target(job, 52, NULL, 0);
} else {
sprintf(xorriso->info_text, "-find -exec: unknown action ");
Text_shellsafe(argv[i], xorriso->info_text, 1);
@ -1915,12 +1919,13 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -if, -then, -elseif, -else, -endif",
" Action may be one of: echo, chown, chown_r, chgrp, chgrp_r",
" chmod, chmod_r, alter_date, alter_date_r, lsdl, compare,",
" rm, rm_r, compare, update, report_damage, report_lba,",
" rm, rm_r, compare, update, report_damage,",
" report_lba, report_sections,",
" getfacl, setfacl, getfattr, setfattr, get_any_xattr,",
" list_extattr, get_md5, check_md5, make_md5,",
" set_hfs_crtp, get_hfs_crtp, set_hfs_bless, get_hfs_bless,",
" set_filter, show_stream, mkisofs_r, hide, print_outname,",
" estimate_size, find",
" set_filter, show_stream, show_stream_id, mkisofs_r,",
" hide, print_outname, estimate_size, find",
" params are their parameters except iso_rr_path.",
" -mkdir iso_rr_path [...]",
" Create empty directories if they do not exist yet.",

View File

@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Version 1.3.9, Oct 28, 2014"
.TH XORRISO 1 "Version 1.3.9, Nov 04, 2014"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -2089,6 +2089,9 @@ E.g.: \-exec sort_weight 3 \-\-
.br
\fBshow_stream\fR
shows the content stream chain of a data file.
\fBshow_stream_id\fR
is like show_stream, but also prints between stream type and first ":"
in square brackets libisofs id numbers: [fs_id,dev_id,ino_id].
.br
\fBhide\fR
brings the file into one of the hide states "on", "iso_rr", "joliet",

View File

@ -1847,6 +1847,11 @@ File: xorriso.info, Node: CmdFind, Next: Filter, Prev: Manip, Up: Commands
E.g.: -exec sort_weight 3 --
show_stream
shows the content stream chain of a data file.
show_stream_id
is like show_stream, but also prints between stream type and
first ":" in square brackets libisofs id numbers:
[fs_id,dev_id,ino_id].
hide
brings the file into one of the hide states "on", "iso_rr",
"joliet", "hfsplus", "off". They may be combined. E.g.:
@ -5572,43 +5577,43 @@ Node: Insert47999
Node: SetInsert58213
Node: Manip67033
Node: CmdFind76813
Node: Filter94263
Node: Writing98885
Node: SetWrite109016
Node: Bootable129722
Node: Jigdo148520
Node: Charset152767
Node: Exception156082
Node: DialogCtl162202
Node: Inquiry164800
Node: Navigate172231
Node: Verify180529
Node: Restore190356
Node: Emulation198960
Node: Scripting209348
Node: Frontend217119
Node: Examples226726
Node: ExDevices227904
Node: ExCreate228570
Node: ExDialog229855
Node: ExGrowing231120
Node: ExModifying231925
Node: ExBootable232429
Node: ExCharset232981
Node: ExPseudo233873
Node: ExCdrecord234771
Node: ExMkisofs235088
Node: ExGrowisofs236428
Node: ExException237563
Node: ExTime238017
Node: ExIncBackup238476
Node: ExRestore242466
Node: ExRecovery243399
Node: Files243969
Node: Seealso245268
Node: Bugreport245991
Node: Legal246572
Node: CommandIdx247583
Node: ConceptIdx264464
Node: Filter94447
Node: Writing99069
Node: SetWrite109200
Node: Bootable129906
Node: Jigdo148704
Node: Charset152951
Node: Exception156266
Node: DialogCtl162386
Node: Inquiry164984
Node: Navigate172415
Node: Verify180713
Node: Restore190540
Node: Emulation199144
Node: Scripting209532
Node: Frontend217303
Node: Examples226910
Node: ExDevices228088
Node: ExCreate228754
Node: ExDialog230039
Node: ExGrowing231304
Node: ExModifying232109
Node: ExBootable232613
Node: ExCharset233165
Node: ExPseudo234057
Node: ExCdrecord234955
Node: ExMkisofs235272
Node: ExGrowisofs236612
Node: ExException237747
Node: ExTime238201
Node: ExIncBackup238660
Node: ExRestore242650
Node: ExRecovery243583
Node: Files244153
Node: Seealso245452
Node: Bugreport246175
Node: Legal246756
Node: CommandIdx247767
Node: ConceptIdx264648

End Tag Table

View File

@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRISO 1 "Version 1.3.9, Oct 28, 2014"
@c man .TH XORRISO 1 "Version 1.3.9, Nov 04, 2014"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -2488,6 +2488,9 @@ E.g.: -exec sort_weight 3 @minus{}@minus{}
@*
@item show_stream
shows the content stream chain of a data file.
@item show_stream_id
is like show_stream, but also prints between stream type and first ":"
in square brackets libisofs id numbers: [fs_id,dev_id,ino_id].
@*
@item hide
brings the file into one of the hide states "on", "iso_rr", "joliet",

View File

@ -1 +1 @@
#define Xorriso_timestamP "2014.10.28.141959"
#define Xorriso_timestamP "2014.11.04.121733"