This function will delete the specified directory.
Input:
name : STRING
Name of the directory to delete. Both absolute and relative paths are allowed.
Returns: INT
0
|
- Directory deleted.
|
-1
|
- Media not open.
|
-2
|
- Media is not formatted.
|
-3
|
- Path to directory invalid.
|
-4
|
- Name of directory invalid.
|
-5
|
- Directory does not exist.
|
-14
|
- Directory is not empty.
|
-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 fsDirDelete : INT;
VAR_INPUT
name : STRING;
END_VAR;
Example:
INCLUDE rtcu.inc
PROGRAM test;
VAR
rc : INT;
END_VAR;
BEGIN
...
rc := fsDirDelete(name := "\Logs");
IF rc = 0 THEN
...
ELSE
...
END_IF;
...
END;
END_PROGRAM;
|