FC_ExistsFile - General Information
Type: |
Function |
Available as of: |
SystemInterface_1.32.6.0 |
Versions: |
Current version |
Check if a file already exists.
This function checks if a file named i_sFileName already exists. You can check files on the following devices:
oide0:
oram0:
oown devices
The default device is "ide0:".
You have to specify the device name in "sFileName", except for the standard device. Separate the device name and the file name by a backslash "\". The folder name has to be specified in the file name of i_sFileName. There is no folder name for the root directory. i_sFileName does not permit any wildcards. The duration of the process depends on the data memory used. When using a CompactFlash the runtime is typically some 10 ms, and some seconds when using network drives via RemoteDevice.
Input |
Data type |
Description |
---|---|---|
i_sFileName |
STRING[80] |
Name of the file whose existence has to be checked |
Data type |
Description |
---|---|
DINT |
0: File was found -1: File does not exist -2: Wildcard in i_sFileName -3: General error detected |
FC_ExistsFile('ide0:\Max4.out');
Return 0 -> The "Max4.out" file on the "ide0:" device was found.
FC_ExistsFile('*.txt');
Return -2 -> wildcard in file name.
FC_ExistsFile('Max4.out');
Return 0 -> The "Max4.out" file on the "ide0:" device was found.