delfolder Synchronous
Remove a workspace folder and everything inside it, including nested folders. A missing folder is ignored. Use it to clean up a dedicated temporary directory. It removes the entire directory tree, so select a folder owned by that cleanup operation.
Luau
delfolder(path: string) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Workspace-relative folder to delete, including all descendants. |
Returns
()This function returns no values.
Usage notes
The workspace root is protected. Passing a file raises an error. This operation permanently removes the folder’s contents.
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
Luau
-- Choose a dedicated folder so existing user files are not removed.
local folder = "disposable-docs-example"
if not isfolder(folder) and not isfile(folder) then
makefolder(folder)
writefile(folder .. "/note.txt", "Temporary")
delfolder(folder)
print(isfolder(folder)) -- false
end