New -find action "set_to_mtime"

This commit is contained in:
Thomas Schmitt 2016-08-20 08:53:02 +00:00
parent b27bd93c2f
commit ff65d7bb19
7 changed files with 80 additions and 49 deletions

View File

@ -182,6 +182,7 @@ struct FindjoB {
56= like 54 but tolerating existing truncated names
57= like 55 but tolerating existing truncated names
58= internal: last_data_file_block
59= set_to_mtime
*/
int action;
int prune;

View File

@ -2431,6 +2431,19 @@ ex:;
}
int Xorriso_set_to_mtime(struct XorrisO *xorriso, char *show_path,
IsoNode *node, int flag)
{
time_t t;
t= iso_node_get_mtime(node);
iso_node_set_atime(node, t);
iso_node_set_ctime(node, t);
Xorriso_set_change_pending(xorriso, 0);
return(1);
}
int Xorriso_cannot_create_iter(struct XorrisO *xorriso, int iso_error,int flag)
{
Xorriso_process_msg_queues(xorriso,0);
@ -2880,6 +2893,9 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
ret= Xorriso_report_lba(xorriso, show_path, node,
&job->last_data_file_block, 2);
} else if(action == 59) { /* set_to_mtime */
ret= Xorriso_set_to_mtime(xorriso, show_path, node, 0);
} else { /* includes : 15 in_iso */
Xorriso_esc_filepath(xorriso, show_path, xorriso->result_line, 0);
strcat(xorriso->result_line, "\n");

View File

@ -1104,6 +1104,10 @@ not_enough_exec_arguments:;
Xorriso_no_findjob(xorriso, "-find -exec alter_date_r", 0);
goto ex;
}
} else if(strcmp(cpt, "set_to_mtime") == 0) {
Findjob_set_action_target(job, 59, NULL, 0);
} else if(strcmp(cpt, "lsdl")==0) {
Findjob_set_action_target(job, 8, NULL, 0);
@ -2022,9 +2026,9 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -prune, -decision yes|no, -true, -false",
" Operators: -not, -or, -and, -sub, (, -subend, ),",
" -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,",
" Action may be one of: echo, chown, chown_r, chgrp, chgrp_r,",
" chmod, chmod_r, alter_date, alter_date_r, set_to_mtime,",
" lsdl, compare, 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,",

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.4.5, Aug 15, 2016"
.TH XORRISO 1 "Version 1.4.5, Aug 20, 2016"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -2027,6 +2027,9 @@ character and a timestring as parameters.
.br
E.g.: \-exec alter_date "m" "Dec 30 19:34:12 2007" \-\-
.br
\fBset_to_mtime\fR
sets the ctime and atime to the value found in mtime.
.br
\fBlsdl\fR
prints file information like shell command ls \-dl.
.br

View File

@ -1732,16 +1732,18 @@ File: xorriso.info, Node: CmdFind, Next: Filter, Prev: Manip, Up: Commands
chown and chown_r
change the ownership and get the user id as parameter. E.g.:
-exec chown thomas --
chgrp and Bchgrp_r
chgrp and chgrp_r
change the group attribute and get the group id as parameter.
E.g.: -exec chgrp_r staff --
chmod and chmod_r
change access permissions and get a mode string as parameter.
E.g.: -exec chmod a-w,a+r --
Balter_date and Balter_date_r
alter_date and alter_date_r
change the timestamps. They get a type character and a
timestring as parameters.
E.g.: -exec alter_date "m" "Dec 30 19:34:12 2007" --
set_to_mtime
sets the ctime and atime to the value found in mtime.
lsdl
prints file information like shell command ls -dl.
compare
@ -5721,44 +5723,44 @@ Node: Insert52745
Node: SetInsert63329
Node: Manip72648
Node: CmdFind82607
Node: Filter100910
Node: Writing105532
Node: SetWrite115688
Node: Bootable140273
Node: Jigdo165009
Node: Charset169268
Node: Exception172597
Node: DialogCtl178726
Node: Inquiry181328
Node: Navigate190116
Node: Verify198411
Node: Restore208289
Node: Emulation216902
Node: Scripting227361
Node: Frontend235144
Node: Examples244770
Node: ExDevices245948
Node: ExCreate246609
Node: ExDialog247909
Node: ExGrowing249180
Node: ExModifying249989
Node: ExBootable250499
Node: ExCharset251054
Node: ExPseudo251950
Node: ExCdrecord252877
Node: ExMkisofs253197
Node: ExGrowisofs254554
Node: ExException255708
Node: ExTime256166
Node: ExIncBackup256624
Node: ExRestore260650
Node: ExRecovery261596
Node: Files262168
Node: Environ263502
Node: Seealso264194
Node: Bugreport264911
Node: Legal265502
Node: CommandIdx266514
Node: ConceptIdx283702
Node: Filter100989
Node: Writing105611
Node: SetWrite115767
Node: Bootable140352
Node: Jigdo165088
Node: Charset169347
Node: Exception172676
Node: DialogCtl178805
Node: Inquiry181407
Node: Navigate190195
Node: Verify198490
Node: Restore208368
Node: Emulation216981
Node: Scripting227440
Node: Frontend235223
Node: Examples244849
Node: ExDevices246027
Node: ExCreate246688
Node: ExDialog247988
Node: ExGrowing249259
Node: ExModifying250068
Node: ExBootable250578
Node: ExCharset251133
Node: ExPseudo252029
Node: ExCdrecord252956
Node: ExMkisofs253276
Node: ExGrowisofs254633
Node: ExException255787
Node: ExTime256245
Node: ExIncBackup256703
Node: ExRestore260729
Node: ExRecovery261675
Node: Files262247
Node: Environ263581
Node: Seealso264273
Node: Bugreport264990
Node: Legal265581
Node: CommandIdx266593
Node: ConceptIdx283781

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.4.5, Aug 15, 2016"
@c man .TH XORRISO 1 "Version 1.4.5, Aug 20, 2016"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -2417,7 +2417,7 @@ as parameter. E.g.: -exec chown thomas @minus{}@minus{}
@*
@c man \fBchgrp\fR and \fBchgrp_r\fR
@c man-ignore-lines 1
@item chgrp and Bchgrp_r
@item chgrp and chgrp_r
change the group attribute and get the group id
as parameter. E.g.: -exec chgrp_r staff @minus{}@minus{}
@*
@ -2429,12 +2429,17 @@ as parameter. E.g.: -exec chmod a-w,a+r @minus{}@minus{}
@*
@c man \fBalter_date\fR and \fBalter_date_r\fR
@c man-ignore-lines 1
@item Balter_date and Balter_date_r
@item alter_date and alter_date_r
change the timestamps. They get a type
character and a timestring as parameters.
@*
E.g.: -exec alter_date "m" "Dec 30 19:34:12 2007" @minus{}@minus{}
@*
@c man \fBset_to_mtime\fR
@c man-ignore-lines 1
@item set_to_mtime
sets the ctime and atime to the value found in mtime.
@*
@item lsdl
prints file information like shell command ls -dl.
@*

View File

@ -1 +1 @@
#define Xorriso_timestamP "2016.08.16.131907"
#define Xorriso_timestamP "2016.08.20.085236"