Wasmer与Wasmtime在WASI文件系统访问中的行为差异问题问询
Wasmer与Wasmtime在WASI文件系统访问中的行为差异问题问询
大家好,我最近在测试基于WASI的文件系统读写功能时,遇到了一个奇怪的问题:Wasmer和Wasmtime两个WebAssembly运行时的行为不一致,想请教下社区的朋友们。
具体情况是:我运行一个实现文件读写的Rust程序时,Wasmtime v21.0.0可以正常执行,但Wasmer v4.3.0却报错提示无法挂载指定的目录,两者其他表现几乎一致,唯独这一点有差异。
以下是我使用的测试代码:
use std::fs; use std::env; use std::io::{Read, Write}; /* Purpose: This crate will showcase read/write file access with WASI */ static FILE_PATH: &str = "/tmp/hello.txt"; fn main() { let args = env::args().collect::<Vec<String>>(); let name = if args.len() >=2 { &args[1] } else { "world" }; let greeting = format!("Hello, {}!", name); let mut output_file = fs::File::create(FILE_PATH) .expect(&format!("error creating {}", FILE_PATH)); output_file.write_all(greeting.as_bytes()) .ex...
有没有朋友遇到过类似的情况?或者能帮我分析下为什么Wasmer会出现挂载目录失败的问题吗?
备注:内容来源于stack exchange,提问作者KubeCuddle
相关产品推荐
相关产品推荐

