We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
hiberfil_sys
1 parent 8d4adad commit 2d06504Copy full SHA for 2d06504
library/std/src/fs/tests.rs
@@ -1535,13 +1535,14 @@ fn read_large_dir() {
1535
}
1536
1537
1538
+/// Test the fallback for getting the metadata of files like hiberfil.sys that
1539
+/// Windows holds a special lock on, preventing normal means of querying
1540
+/// metadata. See #96980.
1541
#[test]
1542
#[cfg(windows)]
1543
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");
1544
+ let hiberfil = r"C:\hiberfil.sys";
1545
- fs::metadata(&hiberfil).unwrap();
1546
- fs::symlink_metadata(&hiberfil).unwrap();
+ fs::metadata(hiberfil).unwrap();
1547
+ fs::symlink_metadata(hiberfil).unwrap();
1548
0 commit comments