From 13ad7091b966adea8b04c851fa731d26cd65b255 Mon Sep 17 00:00:00 2001 From: jakub-nt <175944085+jakub-nt@users.noreply.github.com> Date: Thu, 8 May 2025 18:08:21 +0200 Subject: [PATCH 1/2] Added documentation for `isnewerthantime` Ticket: CFE-2815 Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com> --- reference/functions/isnewerthantime.markdown | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 reference/functions/isnewerthantime.markdown diff --git a/reference/functions/isnewerthantime.markdown b/reference/functions/isnewerthantime.markdown new file mode 100644 index 000000000..5cdd1421f --- /dev/null +++ b/reference/functions/isnewerthantime.markdown @@ -0,0 +1,31 @@ +--- +layout: default +title: isnewerthantime +published: true +--- + +[%CFEngine_function_prototype(file, time)%] + +**Description:** Returns whether the file `file` is newer (modified later) +than the time `time`. + +This function compares the modification time (mtime) of the file, referring to +changes of content only. + +[%CFEngine_function_attributes(file, time)%] + +**Example:** + +Prepare: + +[%CFEngine_include_snippet(isnewerthantime.cf, #\+begin_src prep, .*end_src)%] + +Run: + +[%CFEngine_include_snippet(isnewerthantime.cf, #\+begin_src cfengine3, .*end_src)%] + +Output: + +[%CFEngine_include_snippet(isnewerthantime.cf, #\+begin_src\s+example_output\s*, .*end_src)%] + +**See also:** `isnewerthan()` From 1e5784b6c40d71e436726bbce62a2d2df68f8128 Mon Sep 17 00:00:00 2001 From: jakub-nt <175944085+jakub-nt@users.noreply.github.com> Date: Mon, 19 May 2025 19:57:42 +0200 Subject: [PATCH 2/2] Improve wording around mtime --- reference/functions/isnewerthan.markdown | 5 +++-- reference/functions/isnewerthantime.markdown | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/reference/functions/isnewerthan.markdown b/reference/functions/isnewerthan.markdown index cc222fd8b..198d6c3ce 100644 --- a/reference/functions/isnewerthan.markdown +++ b/reference/functions/isnewerthan.markdown @@ -9,8 +9,9 @@ published: true **Description:** Returns whether the file `newer` is newer (modified later) than the file `older`. -This function compares the modification time (mtime) of the files, referring -to changes of content only. +This function compares the modification time (mtime) of the files. Note that +access changes such as ownership and permissions as well as status changes +such as last time the file was read are not included in the mtime timestamp. [%CFEngine_function_attributes(newer, older)%] diff --git a/reference/functions/isnewerthantime.markdown b/reference/functions/isnewerthantime.markdown index 5cdd1421f..d3b289610 100644 --- a/reference/functions/isnewerthantime.markdown +++ b/reference/functions/isnewerthantime.markdown @@ -9,8 +9,9 @@ published: true **Description:** Returns whether the file `file` is newer (modified later) than the time `time`. -This function compares the modification time (mtime) of the file, referring to -changes of content only. +This function compares the modification time (mtime) of the file. Note that +access changes such as ownership and permissions as well as status changes +such as last time the file was read are not included in the mtime timestamp. [%CFEngine_function_attributes(file, time)%]