Version: 10
restore

Contents

Method

FindDirectoryByName

ModuleFileSystem
LibraryCore
Action

Finds a directory path given a leaf directory name.

Parameters

DirectoryName  (string): The name of the directory to be found. This cannot contain path separators and therefore is always just the leaf node of the path (the deepest part of the path).

The name can include wildcard characters ? and *.

Fast ( boolean; optional, default true): chooses between the fast NTFS search technology or the previous slower (but fully reliable) technology.

Unix fast=false and NTFS fast=true are similar order timescales (unless the Unix method comes across a mounted windows share), NTFS fast=false is significantly slower.

Case insensitive wildcards are supported only on Windows.

Android currently does not support wildcards, exact match is required

Return values

For each directory found:

    • Path (string): The full path of the directory.
Example
FileSystem.FindDirectoryByName(DirectoryName:"wibble", Fast:true);

The above method call might find the following on relevant platforms:

C:\Program Files\Acme Corp\Wibble

/usr/local/wibble

But it will never find these:

C:\Program Files\Acme Corp\Wibble\bin

/usr/local/wibble/bin

Platforms
  • Windows
  • Linux
  • MacOS
  • Solaris Intel
  • Solaris Sparc
  • Android
Notes

This will search all fixed disks which is a resource expensive process and may take some time if fast=false.