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

FunctionDescription
appendfileAppend data to a file
delfileDelete a file
delfolderDelete a folder
dofileLoad and execute a Luau file
getcustomassetGet a content URL for a local file
isfileCheck if a path is a file
isfolderCheck if a path is a folder
listfilesList files in a folder
loadfileLoad a Luau file as a function
makefolderCreate a folder
readfileRead contents of a file
writefileWrite 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