fn main() {
std::fs::remove_dir_all("temp-dir").unwrap();
std::fs::create_dir("temp-dir").unwrap();
std::fs::remove_dir("temp-dir").unwrap(); // this line passes
std::fs::create_dir("temp-dir").unwrap();
std::fs::remove_dir("temp-dir/").unwrap(); // this line fails
}
will fail to execute in Wasmtime:
wasmtime run --dir . ./foo.wasm
thread 'main' panicked at foo.rs:7:38:
called `Result::unwrap()` on an `Err` value: Os { code: 28, kind: InvalidInput, message: "Invalid argument" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: failed to run main module `./foo.wasm`
This causes this test to fail in the wasi-testsuite.
cc @sunfishcode I think this has something to do with this function being used here, although this code looks more subtle than my current understanding. Do you know if this has come up before with cap-std and/or if this is appropriate to fix there?
Currently this program on Linux:
will fail to execute in Wasmtime:
This causes this test to fail in the wasi-testsuite.
cc @sunfishcode I think this has something to do with this function being used here, although this code looks more subtle than my current understanding. Do you know if this has come up before with cap-std and/or if this is appropriate to fix there?