mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Add comment and simplify hiberfil_sys
test
This commit is contained in:
parent
8d4adad953
commit
2d0650457f
@ -1535,13 +1535,14 @@ fn read_large_dir() {
|
||||
}
|
||||
}
|
||||
|
||||
/// Test the fallback for getting the metadata of files like hiberfil.sys that
|
||||
/// Windows holds a special lock on, preventing normal means of querying
|
||||
/// metadata. See #96980.
|
||||
#[test]
|
||||
#[cfg(windows)]
|
||||
fn hiberfil_sys() {
|
||||
// Get the system drive, which is usually `C:`.
|
||||
let mut hiberfil = crate::env::var("SystemDrive").unwrap();
|
||||
hiberfil.push_str(r"\hiberfil.sys");
|
||||
let hiberfil = r"C:\hiberfil.sys";
|
||||
|
||||
fs::metadata(&hiberfil).unwrap();
|
||||
fs::symlink_metadata(&hiberfil).unwrap();
|
||||
fs::metadata(hiberfil).unwrap();
|
||||
fs::symlink_metadata(hiberfil).unwrap();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user