Skip to content

How to enable full filesystem access to WASM? #5289

@Berrysoft

Description

@Berrysoft

As far as I know, we can use preopened_dir to preopen some directories and give WASM binary a limited filesystem access. However, I can't find a simple way to give the binary a full filesystem access. The following code doesn't work (with wasi-cap-std-sync) on Windows:

WasiCtxBuilder::new().preopened_dir(cap_std::fs::Dir::from_std_file(std::fs::File::open("/")?), "/")?.build()

I would also like a cross-platform way to give full filesystem access.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions