This function will return the size of the file specified.
Input:
name : STRING
The name of the file.
Returns: DINT
The size of the file in bytes or the following error codes:
0
|
- File is empty or not present.
|
-1
|
- Media not open.
|
-2
|
- Media is not formatted.
|
-5
|
- Could not find file.
|
-16
|
- Media not present.
|
-17
|
- Media communication error (card not supported).
|
-22
|
- Media is busy.
|
-24
|
- Unknown file system.
|
Declaration:
FUNCTION fsFileGetSize : DINT;
VAR_INPUT
name : STRING;
END_VAR;
Example:
INCLUDE rtcu.inc
PROGRAM test;
VAR
a : DINT;
END_VAR;
BEGIN
...
a := fsFileGetSize(name := "test.txt");
...
END;
END_PROGRAM;
|