blob: 53688eecb088935027acd033f35a5f97b5e3f22d (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
// { "preopens": { "/scratch": "scratch" } }
fn main() {
let old_path = "/scratch/old_file";
let new_path = "/scratch/new_file";
assert!(std::fs::write(old_path, b"Hello, world!").is_ok());
assert!(std::fs::rename(old_path, new_path).is_ok());
assert!(std::fs::read(old_path).is_err());
assert_eq!(std::fs::read(new_path).unwrap(), b"Hello, world!");
}
|