Description

Retrieves file names from a specified directory.

Syntax

fileList = RTI_OS_Directory( "GetFiles", directory <,file_filter> <, attrib_filter> )

Parameters

directoryThe directory from which to retrieve the file list.
name_filter<Optional> Filename filter. Supports the the use of wild cards ? and *.
attrib_filter<Optional> File attributes filter. Refer to SetInitDirOptions subroutine for more information.

Return Value

An @fm-delimited list of file names (not including the directory).

Example 1

declare function RTI_OS_Directory
 
// returns an @fm delimited list of files in the specified directory
directory = "c:\revsoft"
files = RTI_OS_Directory( "GETFILES", directory)

Example 2

declare function RTI_OS_Directory
 
// returns an @fm delimited list of files in the specified directory matching the filename
// filter.
// In this example files matching the file extension .pdf will be returned.
directory = "c:\revsoft\oinsight"
filter = "*.pdf"
result = RTI_OS_Directory( "GETFILES", directory, filter )

Example 3

declare function RTI_OS_Directory
 
// returns an @fm delimited list of files in the specified directory matching the filename
// filter and the special attributes filter.
// In this example a list of files with a .pdf extension which have the archive attribute will
// be returned.
directory = "c:\revsoft"
filter = "*.pdf"
attributes = "A"
result = RTI_OS_Directory( "GETFILES", directory, filter, attributes )



  • No labels