RbxStu V3 Docs
  • Welcome
  • Information
    • Engine Information
      • Luau API Security
  • Stunc
    • Overview
    • Connections
    • Filesystem
      • readfile
      • writefile
      • appendfile
      • isfile
      • isfolder
      • listfiles
      • makefolder
      • delfile
      • delfolder
      • loadfile
      • dofile
  • Memory
    • getgc
    • reference_object
    • unreference_object
    • get_gc_threshold
  • Closures
    • isunhookable
    • makeunhookable
    • ishooked
    • restorefunction
    • hookfunction
    • hookmetamethod
    • isourclosure
    • iscclosure
    • islclosure
    • clonefunction
    • newcclosure
    • newlclosure
    • loadstring
Powered by GitBook
On this page
  1. Stunc
  2. Filesystem

delfolder

Overview of the delfolder function.

Function definition
function delfolder(path: string): ()

Errors:

  • Illegal Path

    • The path provided is considered 'unsafe'.

  • failed to delete folder and all subfolders with error: "..."

    • Occurs when the folder or one of its subfolders cannot be deleted.

    • ... will be the error message provided by the standard C++ filesystem library.

Remarks

If the provided folder does not exist at path, then the function does nothing.

High-Level Overview:

Deletes the folder present at path, including all the files and subfolders it may contain.

Low-Level Overview:

pathis read from the luau heap, then utilising std::filesystem::is_directorywe validate if the provided path (once sanitised) is pointing to a valid directory in the filesystem; if so, it is deleted utilizing std::filesystem::remove_all.

PreviousdelfileNextloadfile

Last updated 4 months ago