wasmer/lib/wasi-tests/wasitests/mapdir.rs

21 lines
456 B
Rust
Raw Normal View History

// Args:
// mapdir: .:wasitests/test_fs/hamlet
use std::fs;
fn main() {
2019-07-13 23:00:18 +00:00
// #[cfg(not(target_os = "wasi"))]
// let read_dir = fs::read_dir("wasitests/test_fs/hamlet").unwrap();
// #[cfg(target_os = "wasi")]
let read_dir = fs::read_dir(".").unwrap();
let mut out = vec![];
for entry in read_dir {
out.push(format!("{:?}", entry.unwrap().path()));
}
out.sort();
for p in out {
println!("{}", p);
}
}