delfile Synchronous

Remove a file from the workspace, such as a temporary export or an outdated settings file. A path that is already missing is ignored. Use isfile or listfiles when selecting the file to remove. The operation deletes stored contents rather than moving them to a temporary trash location.

Syntax
Luau
delfile(path: string) -> ()

Parameters

Function parameters
ParameterTypeDescription
pathstringWorkspace-relative path of the file to delete.

Returns

()

This function returns no values.

Usage notes

Deletion is permanent. A folder at the supplied path raises an error; use delfolder to remove a folder.

Differences from Volt

Volt documents access through explicitly created workspace symlinks. Kawaii rejects symlinks in workspace paths; all workspace operations remain subject to its path containment checks.

Example

Example
Luau
writefile("temporary-note.txt", "Draft")
delfile("temporary-note.txt")
print(isfile("temporary-note.txt")) -- false
Kawaii documentation