FC_DirListCreate - General Information

Overview

Type:

Function

Available as of:

SystemInterface_1.32.6.0

Versions:

Current version

Task

Search for one or several files and create a list of those files that are found.

Description

Use this function to create a list of files. You transfer a filter for file names to the FC_DirList­Create() function. This function searches for the files in the specified directory that match the i_sSearchFilter search filter. The names and sizes of the files are stored in a list. The number of files found is returned. Using the function FC_DirListEntryGet(), you can read the file information found from the list. You can search for files on the following devices:

oide0:

oram0:

You cannot search for files on RemoteDevices. The default device is "ide0:".

You have to specify the device name (except for DefaultDevice) in the i_sSearchFilter transfer parameter. Separate the device name and the search filter by a backslash '\'. The following special characters may be used:

Asterisk: * => any character from 0-n

Point: . => Separator between file name and file extension

The file information is permanently available after ending the FC_DirListCreate() function. The file information is updated when you call the FC_DirListCreate() function again. The file information is deleted by resetting the program.

NOTE: The processing time of this function is usually some 10 milliseconds. There must be a one-time increase in the times for the cycle check of the task in which the function is executed. For example FC_CycleCheckTimeSet(50, 100).

Interface

Input

Data type

Description

i_sSearchFilter

STRING[80]

Filter for file names that shall be searched for

Return Value

Data type

Description

DINT

>= 0: Number of files or directories found that match the transferred search filter

-1: The specified device was not found or the specified device is a RemoteDevice.

Examples

FC_DirListCreate ('*.*');

-> The function searches for the files on the "ide0:" device.


FC_DirListCreate ('*');

-> The function searches for the files including directories on the "ide0:" device.


FC_DirListCreate ('ram0:\*.*');

-> The function searches for the files on the "ram0:" device.


FC_DirListCreate ('*.mon');

-> The function searches for the trace files on the "ide0:" device.


FC_DirListCreate ('aa*.*');

-> The function searches for the files on the "ide0:" device whose file names start with "aa".


FC_DirListCreate ('a*b.*');

-> The function searches for the files on the "ide0:" device whose file names start with "a" and end with "b". There can be any characters between these letters.