Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (19 sloc) 744 Bytes
layout title published tags
default
dirname
true
reference
files functions
functions
dirname

[%CFEngine_function_prototype(path)%]

Description: Return the parent directory name for given path.

This function returns the directory name for path. If path is a directory, then the name of its parent directory is returned.

[%CFEngine_function_attributes(path)%]

Example:

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

Output:

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

Notes:

History: Was introduced in 3.3.0, Nova 2.2.0 (2011)

See also: [lastnode()][lastnode], [filestat()][filestat], [splitstring()][splitstring].

You can’t perform that action at this time.