Version: v0.8.1 - Beta.  We welcome contributors & feedback.

File.delete

$file.delete($options) -> self

Description

Delete (unlink) the file.

If the target file does not already exist, an error will be triggered.

$dataFile = file'files:/data.txt'

$dataFile.delete()

$dataFile.exists()
//= false

Options

Option Value Description
ifExists true/false Don’t trigger an error if the file does not exist.
file'files:/data.txt'.delete(-ifExists)

See Also