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 - File object name - in the range: "?(/.*)

Example:

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

bundle agent example
{
  classes:

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

  reports:

    isdir::

      "Directory exists..";

}

Output:

code
R: Directory exists..

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