isdir

Table of Contents

Prototype: isdir(filename)

Return type: boolean

Description: Returns whether the named object filename is a directory.

The CFEngine process must have access to filename in order for this to work.

Arguments:

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

Example:

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

bundle agent example
{
  classes:

      "isdir" expression => isdir("/");

  reports:

    isdir::

      "Directory exists..";

}

Output:

R: Directory exists..

See Also: fileexists(), filestat(), islink(), isplain(), returnszero()