Module rune_modules::fs

source ·
Expand description

The native fs module for the Rune Language.

§Usage

Add the following to your Cargo.toml:

rune-modules = { version = "0.13.2", features = ["fs"] }

Install it into your context:

let mut context = rune::Context::with_default_modules()?;
context.install(rune_modules::fs::module(true)?)?;

Use it in Rune:

fn main() {
    let file = fs::read_to_string("file.txt").await?;
    println(`{file}`);
}

Functions§

  • Construct the fs module.