← SPL reference

File I/O

Built-in file.* and json.* helpers. Paths are relative to the process working directory — no .., no absolute paths.

Sandbox

Reading & writing

Filesystem helpers

JSON

file.mkdir("tmp_demo");
p.setVar(file.join("tmp_demo", "note.txt"));
file.write("hello", p);
print.number(file.exists(p));
print.string(file.read(p));
names.setVar(file.listdir("tmp_demo"));
print.list(names);

Example: examples/file_io_demo.spl