summaryrefslogtreecommitdiff
path: root/std/wasi/testdata/std_fs_file_write.rs
blob: 6e646ba1d9a3475cceb913f948a1523c48fd6d78 (plain)
1
2
3
4
5
6
7
8
9
// { "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);
}