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

dofile

Overview of the dofile function.

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

Remarks

The function internally uses task.spawnto schedule the thread; this function will inherit errors from readfile, as internally the function is reused for simplicity's sake.

High-Level Overview:

Reads the contents at the file present at path, then calls loadfileand schedules the function to run on a new thread created from the current one.

Low-Level Overview:

pathis read from the luau heap, then loadfile is pushed onto the luau stack and it's arguments are prepared; once done, it will obtain task.spawnand call it, with the first argument being the function obtained from loadfile.

PreviousloadfileNextMemory

Last updated 4 months ago