string DeleteDirectory(string, bool)

Deletes a directory from the filesystem.

Security

Trust Level Required: Full Trust

Parameters

Name Description
dirPath string
The path of the directory to delete.
recursive bool
If true, delete all contents of the directory recursively. Otherwise, only attempt to delete the top-level directory.

Return

A JSON string where Bool indicates if the function succeeded and Str is an error message on failure.

Examples


var strresult = KioFileIO.DeleteDirectory('/sdcard/path/to/delete', true);
var objresult = JSON.parse(strresult);
if (!objresult.Bool) {
    alert('Error deleting directory: ' + objresult.Str); 
} else {
    alert('Directory deleted!');
}
    

Requirements

KioWare for Android version 3.16 or greater.