Vital.sandbox
File

file.delete

Shared

Deletes a specified file


Syntax

local status = file.delete(path)

Prefix the path with :resourcename to access files from another running resource.

  • Local path — resolves relative to the current resource's directory
  • Cross-resource path — prefix with :resourcename to resolve relative to another running resource's directory
  • Example:resource_a/files/images/test.png accesses files/images/test.png inside resource_a

Parameters

TypeNameDescription
stringpathFile path to delete

Returns

TypeNameDescription
boolstatustrue on successful execution, or false on failure

Examples

Delete a file within the current resource
engine.print("info", "File deleted:", file.delete("files/images/test.png"))
Delete a file from another running resource
engine.print("info", "File deleted:", file.delete(":resource_a/files/images/test.png"))

On this page