[%CFEngine_function_prototype(filename, field)%]

Description: Returns the requested file field field for the file object filename.

If the file object does not exist, the function call fails and the variable does not expand.

Arguments:

On Mac OS X, you can list and set extended attributes with the xattr utility.

On SELinux, the contexts are the same as what you see with ls -Z.

Example:

Prepare:

[%CFEngine_include_snippet(filestat.cf, #+begin_src prep, .*end_src)%]

Run:

[%CFEngine_include_snippet(filestat.cf, #+begin_src cfengine3, .*end_src)%]

Output:

[%CFEngine_include_snippet(filestat.cf, #+begin_src\s+example_output\s, .end_src)%]

Notes:

History:

See also: dirname(), fileexists(), isdir(), islink(), isplain(), lastnode(), returnszero(), splitstring().