1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-27 01:29:14 -05:00
denoland-deno/std/wasi/testdata/std_fs_file_write.rs

10 lines
274 B
Rust
Raw Normal View History

// { "preopens": { "/scratch": "scratch" }, "files": { "scratch/file": "file" } }
use std::io::Write;
fn main() {
let mut file = std::fs::File::create("/scratch/file").unwrap();
assert_eq!(file.write(b"fi").unwrap(), 2);
assert_eq!(file.write(b"le").unwrap(), 2);
}