Contents

Roo

FileUtils.delete()

Deletes a specified file or folder on disk. Returns True if the file was successfully deleted, False if not.

FileUtils.delete(what as File or Text) as Boolean

Parameters

  • what: File or Text object. The file or folder to delete. It should be a valid relative or absolute path or a valid File object.

Returns

  • True if the deletion was successful, False if it failed

Notes

  1. Text paths use forward slashes (/) as separators
  2. Absolute paths begin with a forward slash, relative paths do not

Example

var f = File("/Users/garry/Desktop/test.txt")
FileUtils.delete(f)