Workspace Filesystem
Read, write and manage files inside the sandboxed workspace folder.
A sandboxed workspace folder next to the External. Paths cannot escape it, and every function here is relative to it.
The everyday set
if not isfolder("logs") then
makefolder("logs")
end
writefile("logs/session.txt", "started\n")
appendfile("logs/session.txt", "still going\n")
if isfile("logs/session.txt") then
print(readfile("logs/session.txt"))
end
for _, path in ipairs(listfiles("logs")) do
print(path)
endCheck before reading
readfile on a missing path errors. isfile first, or wrap it — the difference matters most in a script that runs on every launch.