Filesystem
The Filesystem library provides functions for reading, writing, and managing files in Volt's workspace.
You cannot access files outside the workspace folder for security reasons, unless an explicit symlink is created within the workspace folder.
Overview
These functions allow you to:
- Read and write files
- Create and delete files and folders
- Check if files and folders exist
- List directory contents
Available Functions
| Function | Description |
|---|---|
appendfile | Append data to a file |
delfile | Delete a file |
delfolder | Delete a folder |
dofile | Load and execute a Luau file |
getcustomasset | Get a content URL for a local file |
isfile | Check if a path is a file |
isfolder | Check if a path is a folder |
listfiles | List files in a folder |
loadfile | Load a Luau file as a function |
makefolder | Create a folder |
readfile | Read contents of a file |
writefile | Write data to a file |
Workspace Folder
All file operations are relative to Volt's workspace folder. Paths that lexically escape that folder are rejected.
-- These are relative to the workspace folder
writefile("myfile.txt", "Hello") -- workspace/myfile.txt
writefile("subfolder/file.txt", "Hi") -- workspace/subfolder/file.txt