Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
This routine is available starting with SIL Engineā„¢ 2.5.15 / 2.6.7.
Info
titleAvailability
Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

findDirectories(directory, regex)

Package

file

Alias

...

Pkg Usage

findDirs(

...

directory, regex)

Description

Excerpt
hiddentrue
Searches for directories that match the given regex in the specified folder.

Searches for directories that match the given regex in the specified folder. The routine only searches for directories, not files.

...

Returns a list with absolute paths for directories that match the given regex. The regex match is done on the file name, not the full path. If the regex parameter is empty string, the routine returns an empty result.

Parameters

Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingfalse

Parameter name

Type

Required

Description

directory

...

String

Yes

Specifies the directory to search in.

regex

...

String

Yes

Specifies the file pattern to search for.

Return

...

Type

string String []Returns an array containing the absolute paths of all directories from the given directory which name match the regex.

Example

Code Block
findDirectories("C:/JIRA/plugins", "kepler.*");

Results: An array containing all absolute paths for folders starting with 'kepler' from the folder C:\JIRA\plugins.

...

Note

  1. It is recommended that you use forward slashes ( / ) for file paths.
  2. If the regex contains a backslash replace it with two backslashes otherwise you will get a syntax error.

See also

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "file_routines"routine" and space = currentSpace ( )
labelsfilearray_routines