Filesystem

delfolder

Deletes an existing folder inside the workspace recursively with recursive folder deletion.

Syntax

delfolder(path: string)

Arguments

NameTypeDescription
pathstringPath resolved inside the workspace after separator normalization and workspace-boundary checks. The target must exist and be a directory; files are not accepted.

Description

Deletes an existing folder inside the workspace recursively with recursive folder deletion.

Call it with 1 parameter(s): path. The argument table explains which values are required and which ones only refine the behavior.

It does not return data. Treat the call as an action and handle errors around the call site when needed.

Example

Delete an existing workspace folder and its contents.

local path = "examples/temporary"
makefolder(path)
writefile(path .. "/note.txt", "temporary")

delfolder(path)
print(isfolder(path))