mirror of
https://github.com/denoland/deno.git
synced 2024-11-23 15:16:54 -05:00
16 lines
460 B
Rust
16 lines
460 B
Rust
|
// { "preopens": { "/scratch": "scratch" } }
|
||
|
|
||
|
fn main() {
|
||
|
let file = std::fs::File::create("/scratch/file").unwrap();
|
||
|
|
||
|
assert!(file.set_len(5).is_ok());
|
||
|
assert!(file.sync_all().is_ok());
|
||
|
let metadata = std::fs::metadata("/scratch/file").unwrap();
|
||
|
assert_eq!(metadata.len(), 5);
|
||
|
|
||
|
assert!(file.set_len(25).is_ok());
|
||
|
assert!(file.sync_all().is_ok());
|
||
|
let metadata = std::fs::metadata("/scratch/file").unwrap();
|
||
|
assert_eq!(metadata.len(), 25);
|
||
|
}
|