Keep in mind that we are still building things, so the docs could be totally wrong or incomplete.
null0
Filesystem
💾

The idea with files is that you can read anything in the cart (a zip file) and write to files that are overlayed. This means that you will not modify the cart, but the user will have the same files in the cart filesystem the next time they run your cart.

Here is an example:

Source: input (opens in a new tab)

It will increment a counter in the file, each time it's loaded.

# read a file into a string
var contents = file_read("file.txt")
 
# write a string to a file
file_write("file.txt", contents)

This may change to use WASI, so it will work however reading-files works in the target language (regular C way, readFile in nim, etc.)