Skip to content

Phylliida/RustInMemoryWasmFileSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 

Repository files navigation

UNDER CONSTRUCTION

What is it?

This is a ~200KB "polyfill" that hosts an file system in memory, in pure wasm.

It is developed around a rust port I made of the v86 js emulator's file system.

All wasm file system WASI commands can be forwarded to this file system, allowing you to run web assembly programs that use the file system without giving it access to the file system.

Symlinks are supported!

Solutions like this exist for javascript, but this is pure rust -> pure wasm, which is more suitable for use cases outside the browser.

What WASI file system commands are supported?

Every fd_ and path_. See The wasi reference or the code for more information

To Compile

rustup install nightly 
rustup target add wasm32-unknown-unknown --toolchain nightly
cd rust
make

What about stdin/stdout/stderr?

In progressff

How do I use this in my rust code?

Just use regular file system commands like you would in any other rust program, and then target wasm32-wasip1. That'll export any WASI file system commands you need, and you can connect them up to this wasm.

Alternatives

I wasn't able to find any suitable alternatives online.

The following are rust, in memory file system alternatives that may be worth writing WASI wrappers for (but don't currently have WASI wrappers for them)

Further reading

Other in memory file system implementations

About

rust port of the file system in the v86 js emulator, intended for use as a wasi polyfill

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors