FC_DeleteDir - General Information

Overview

Type:

Function

Available as of:

SystemInterface_1.32.6.0

Versions:

Current version

Task

Delete directory.

Description

This function deletes a directory with the name that is transferred in i_sDirName. You can delete directories on the following devices:

  • ide0:

  • ram0:

You cannot delete directories on a RemoteDevice. The default device is "ide0:".

You must specify the device name, except for the default device name, in i_sDirName . Separate the device name and the directory name by a backslash "\". The directory to be deleted may not contain any files. In this case, the directory is not deleted and diagnostic message "-2" is returned in Result. i_sDirName does not permit any wildcards. The duration of the process depends on the data memory used. When using a CompactFlash, runtime is typically 10 to 100 ms.

If you try to delete a system directory on the controller flash disk with this function, you get -5 as the return value (see below). The system directory is not deleted.

Interface

Input

Data type

Description

i_sDirName

STRING[80]

Name of the directory that has to be deleted

Return Value

Data type

Description

DINT

0: No detected error.

-1: The directory does not exist or the specified device is on a remote file system

-2: directory contains files

-3: Wildcard in i_sDirName

-4: General error detected

-5: You are trying to delete a system directory.

Examples

 FC_DeleteDir('ide0:\Test');  

Return 0: => The "Test" directory was deleted on the "ide0:" device.


FC_DeleteDir('ide0:\Test');  

Return -1: => The "Test" directory on the "ide0:" device could not be deleted, as it was not found.


FC_DeleteDir('Test1\Test2');  

Return -2: => The "Test 2 " subdirectory was not deleted in the "Test1" directory on the "ide0:" device, as the "Test2" directory contains files.