references/sleep-functions/deleteFile.md

GitHub

deleteFile

Category: FileSystem

Source: https://sleep.dashnine.org/manual/deleteFile.html


Synopsis

$ deleteFile("file")

Deletes the specified file/directory.

Parameters

"file" - the name of the file to delete.

Returns

The filename if the operation was successful or $null.

Side Effects / Notes

  • Hopefully this function deletes the file.

Examples

Example:

# format someones hard drive...

sub deleteAll
{
if (-isDir $1)
{
map(&deleteAll, ls($1));
}
deleteFile($1);
}

# I work on a mac by default... .
deleteAll("c:/");

See Also

&createNewFile; &mkdir; &rename