Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 885 Bytes

lsdir.markdown

File metadata and controls

38 lines (25 loc) · 885 Bytes
layout title categories published alias tags
default
lsdir
Reference
Functions
lsdir
true
reference-functions-lsdir.html
reference
files functions
functions
lsdir

Prototype: lsdir(path, regex, include_base)

Return type: slist

Description: Returns a list of files in the directory path matching the regular expression regex.

In case include_base is true, full paths are returned, otherwise only names relative to the the directory are returned.

Arguments:

  • path : Path to base directory, in the range .+
  • regex : Regular expression to match files or blank, in the range .*
  • include_base : Boolean

Include the base path in the list.

Example:

    vars:
      "listfiles" slist => lsdir("/etc", "(passwd|shadow).*", "true");

Notes:

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