Back

DeleteFile

Hello World

DeleteFile deletes a given file from the filesystem.

app.DeleteFile( file )

This makes it hard to restore it!

See Also: WriteFile, RenameFile, FileExists

Example - Delete created file

function OnStart()
{
    app.WriteFile( "myFile.txt", "Bye World!\n", "Append" );

    app.DeleteFile("myFile.txt");

    if(app.FileExists("myFile.txt"))
        app.ShowPopup("myFile was not deleted!");
    else
        app.ShowPopup("myFile was deleted!");
}
    Copy     Copy All       Run      
string: path to file or folder ( “/absolute/...” or “relative/...” )