← All examples

Files with vos.fs

Write, read, list, rename and delete files, then check them in Your files on the right. It updates live, so you can see exactly what your code saved.

1Write a file

Overwrites the file if it exists. Missing folders are created for you.

2Read a file

Resolves to the text, or null when the file doesn't exist. Tip: click any file in Your files to read it.

3List a folder

Folders come first, each entry has a name and a type ("folder" or the file's extension).

4Save and load JSON

The usual way to keep app data: one JSON file. Loading falls back to a default when the file is missing or damaged.

5Rename or move

Takes full paths on both sides and works for files and folders.

6Delete

Deleting a folder removes everything inside it.

7See a permission error

This example may only use home/Documents. Writing anywhere else fails the same way it will inside VibeOS.

WaitingRun something on the left
// The exact call appears here
Return values and errors show up here, exactly as your code would get them.

Your files

Loading…live · home/Documents
Click a file to read it and load it into Write a file so you can edit it. The VibeOS dev badge in the corner lists every file in the dev home folder.

Activity

Every call this page made. Click one to see its result again.

    Use it in your app

    The helpers this page runs on. Copy them into your app as they are.