You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 11:18:05