Expand description

POSIX file system support.


use std::sync::Arc;

use anyhow::Result;
use opendal::services::fs;
use opendal::services::fs::Builder;
use opendal::Accessor;
use opendal::Object;
use opendal::Operator;

async fn main() -> Result<()> {
    // Create fs backend builder.
    let mut builder: Builder = fs::Backend::build();
    // Set the root for fs, all operations will happen under this root.
    // NOTE: the root must be absolute path.
    // Build the `Accessor`.
    let accessor: Arc<dyn Accessor> = builder.finish().await?;

    // `Accessor` provides the low level APIs, we will use `Operator` normally.
    let op: Operator = Operator::new(accessor);

    // Create an object handle to start operation on object.
    let _: Object = op.object("test_file");



Backend is used to serve Accessor support for posix alike fs.

Builder for fs backend.