Get files

Command groupFlag affectedReversibleExecute on clientPlatform(s)
External commandsYESNONOWindows,Linux

Syntax

Get files
 
(list-name, first-column, path, file-type [,creator-type] [,8.3])
 
Returns 
err-code

Description

Note: The flag is set according to whether Omnis was able to make a call to this external command.

This command returns a list of files in a directory or folder.

To list only files of a specified type, specify the file-type, which is a wildcard, such as ‘*.LBS’.

If you omit the file-type, the command returns the names of all the files.

You specify the list with list-name. The list must have a column defined as list-column-name, where list-column-name is the name of a variable. This column will receive the names of the files found under the specified path-name, including the extension.

On Windows, you can also supply the 8.3 parameter. This defaults to kFalse. If you pass kTrue, then Get files returns the 8.3 name equivalent to any long file names.

It returns an error code (See Error Codes), or zero if no error occurs.

The following example uses Get files to build a list of all the libraries in the folder returned by sys(10).

Example

Do
 
lFileList
.
$define
(
lFileName
)

 
# get the path of the examples folder in the studio tree

Calculate
 
lPathname
 as 
con
(
sys
(115),
'welcome'
,
sys
(9),
'examples'
)

 
# return the list of all example libraries

Get files
 
(
lFileList
,
lFileName
,
lPathname
,
'*.lbs'
)
 
Returns 
lErrCode