changedbefore

Table of Contents

Prototype: changedbefore(newer, older)

Return type: boolean

Description: Compares the ctime fields of two files.

Returns true if newer was changed before older, otherwise returns false.

Change times include both file permissions and file contents. Comparisons like this are normally used for updating files (like the 'make' command).

Arguments:

  • newer: string, in the range: "?(/.*)
  • older: string, in the range: "?(/.*)

Example:

    body common control
    {
      bundlesequence  => { "example" };
    }

    bundle agent example
    {
      classes:

        "do_it" and => { changedbefore("/tmp/earlier","/tmp/later"), "linux" };

      reports:

        do_it::

          "The derived file needs updating";
    }