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
@spec cat(Raxol.Commands.FileSystem.t(), String.t()) :: Raxol.Commands.FileSystem.t()
Print file contents.
@spec cd(Raxol.Commands.FileSystem.t(), String.t()) :: Raxol.Commands.FileSystem.t()
Change working directory.
@spec ls(Raxol.Commands.FileSystem.t(), String.t()) :: Raxol.Commands.FileSystem.t()
List directory contents.
@spec mkdir(Raxol.Commands.FileSystem.t(), String.t()) :: Raxol.Commands.FileSystem.t()
Create a directory.
@spec pwd(Raxol.Commands.FileSystem.t()) :: Raxol.Commands.FileSystem.t()
Print working directory.
@spec rm(Raxol.Commands.FileSystem.t(), String.t()) :: Raxol.Commands.FileSystem.t()
Remove a file or empty directory.
@spec stat(Raxol.Commands.FileSystem.t(), String.t()) :: Raxol.Commands.FileSystem.t()
Show filesystem node metadata.
@spec touch(Raxol.Commands.FileSystem.t(), String.t(), String.t()) :: Raxol.Commands.FileSystem.t()
Create a file with optional content.
@spec tree(Raxol.Commands.FileSystem.t(), String.t(), non_neg_integer()) :: Raxol.Commands.FileSystem.t()
Print directory tree.