GetFiles method (WinStudio scripts)

Applies to

Document (file) operations

Description

Retrieves a list of files or objects in a folder.

Syntax

GetFiles( string fileSpec, string servername, string logicalFolderName, [GetFilesAction.action], out string errorMessage )

where:

  • fileSpec is the name of the requested file.
  • servername is the file server on which the files are located.
  • logicalFolderName is the name of the logical folder on the file server where the files or objects are located.
  • action specifies exactly what is to be returned in the list (see Remarks).
  • errorMessage is the error message to be returned if no files or objects are found.

Remarks

The GetFilesAction argument specifies what the list is to consist of. Options include:

  • GetFilesAction.File – List of file names
  • GetFilesAction.FileFullPath – List of file names with the relative paths
  • GetFilesAction.Directory – List of directories
  • GetFilesAction.DirectoryFullPath – List of directories with the relative paths
  • GetFilesAction.DirectoryTreeFullPath – List of files and directories with their relative paths

If no GetFilesAction argument is included, this method simply returns the list of files in a folder.