Volt

Filesystem

The Filesystem library provides functions for reading, writing, and managing files on the local system.

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 Lua 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 Lua 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. This is a sandboxed directory that prevents access to sensitive system files.

-- These are relative to the workspace folder
writefile("myfile.txt", "Hello")        -- workspace/myfile.txt
writefile("subfolder/file.txt", "Hi")   -- workspace/subfolder/file.txt

On this page