islink

Table of Contents

Prototype: islink(filename)

Return type: boolean

Description: Returns whether the named object filename is a symbolic link.

The link node must both exist and be a symbolic link. Hard links cannot be detected using this function.

Arguments:

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

Example:

Prepare:

ln -fs /tmp/cfe_testhere.txt /tmp/link

Run:

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

bundle agent example
{
  classes:

      "islink" expression => islink("/tmp/link");

  reports:

    islink::

      "It's a link.";

}

Output:

R: It's a link.