ListDir (list local directory)

function ListDir(what, mask: string) []DirListItem

The ListDir function lists the contents of a directory in the local file system, and returns the results in a JavaScript array of DirListItem objects.

This functions accepts either 1 or 2 parameters:

  • what must be a valid and existent directory on a local file system, this parameter is mandatory

  • mask is a file-mask (example: *.docx) to limit the scope of the returned results only to items matching such mask

Example:

{
  ConsoleFeedback = true;
  // List local directory
  files = ListDir('C:\\windows\\system32');
  // Log all entries
  for (var i = 0; i < files.length; i++) {
    Log(files[i].Name);
  }
}