Raxol.REPL.VfsHelpers (Raxol v2.6.0)

View Source

Shell-like helper functions for the virtual filesystem in REPL sessions.

Functions print their output via IO (captured by the evaluator) and return the VFS struct, making them chainable:

vfs = ls(vfs)
vfs = mkdir(vfs, "/docs")
vfs = touch(vfs, "/docs/readme.txt", "Hello!")
vfs = cat(vfs, "/docs/readme.txt")

Enable with Evaluator.with_vfs/1 which seeds a vfs binding and auto-imports this module into each evaluation.

Summary

Functions

Print file contents.

Change working directory.

List directory contents.

Create a directory.

Print working directory.

Remove a file or empty directory.

Show filesystem node metadata.

Create a file with optional content.

Print directory tree.

Functions

cat(fs, path)

Print file contents.

cd(fs, path)

Change working directory.

ls(fs, path \\ ".")

List directory contents.

mkdir(fs, path)

Create a directory.

pwd(fs)

Print working directory.

rm(fs, path)

Remove a file or empty directory.

stat(fs, path)

Show filesystem node metadata.

touch(fs, path, content \\ "")

Create a file with optional content.

tree(fs, path \\ "/", depth \\ 3)

Print directory tree.