This deletes a file on the media.
Input:
name : STRING
Name of the file to delete. Both absolute and relative paths are allowed.
Returns: INT
0
|
- File deleted.
|
-1
|
- Media not open.
|
-2
|
- Media is not formatted.
|
-3
|
- Path to file is not found.
|
-4
|
- Name of file is illegal.
|
-5
|
- File not found.
|
-12
|
- File is open.
|
-16
|
- Media not present.
|
-17
|
- Media communication error (card not supported).
|
-22
|
- Media is busy.
|
-23
|
- Media is Write protected.
|
-24
|
- Unknown file system.
|
Declaration:
FUNCTION fsFileDelete : INT;
VAR_INPUT
name : STRING;
END_VAR;
Example:
INCLUDE rtcu.inc
PROGRAM test;
VAR
rc : INT;
END_VAR;
BEGIN
...
rc := fsFileDelete(name := "\prg1.log");
IF rc = 0 THEN
...
ELSE
...
END_IF;
...
END;
END_PROGRAM;
|