Filesystem
The Filesystem library provides access to an executor's virtual file system. It enables reading, writing, creating, and deleting files and folders, as well as utility functions for interacting with content assets.
This library is especially useful when storing persistent data, managing resources across sessions, or loading runtime content dynamically.
What can you do?
With the Filesystem library, you can:
- Write data to a file using
writefile
- Read file contents with
readfile
- Append content using
appendfile
- List files and folders via
listfiles
- Delete files with
delfile
and folders usingdelfolder
- Check if a path is a file or folder using
isfile
orisfolder
- Create folders with
makefolder
- Dynamically load code from a file via
loadfile
- Use local assets in Roblox via
getcustomasset
, as if it were an uploaded asset
What can't you do?
- You cannot access files outside the executor's workspace/sandboxed storage
- You cannot use file IO to interact with the real disk (e.g.
C:/
(Windows),/Library
(macOS), etc.) - You cannot escape the executor's
workspace
folder at all.