Compare commits

..

7 commits

Author SHA1 Message Date
6344577a40 feat(fs): add .path(path).read_link() 2024-11-03 22:14:31 +00:00
e576e6e579 refactor(fs): PathReal owns its own data 2024-11-03 22:14:28 +00:00
10a745899d feat(fs): add .path(path).set_permissions(perms) 2024-11-03 22:14:26 +00:00
0db3bd40fe docs(fs): make it clearer what the std::fs functions map to 2024-11-03 22:14:24 +00:00
74977947d9 docs(fs): move checklist/std::fs mapping to rustdoc 2024-11-03 22:14:21 +00:00
8404b9fd8e feat(fs): add .path(path).symlink_metadata() 2024-11-03 22:14:03 +00:00
35791fe389 feat(fs): add .path(path).canonicalize()
Some checks failed
Rust / build (map[name:nightly]) (push) Failing after 41s
Rust / build (map[name:stable]) (push) Failing after 3m53s
2024-11-03 22:13:37 +00:00

View file

@ -794,12 +794,8 @@ mod canonicalize {
let link = fs.path(&link_path); let link = fs.path(&link_path);
file.soft_link(&link).expect("create"); file.soft_link(&link).expect("create");
let canonical = link.canonicalize().expect("canonicalize"); let canonical = link.canonicalize().expect("canonicalize");
let canonical = if canonical.starts_with("/private") { // macos puts all temp files under /private
// INFO: macos puts all temp files under /private let canonical = Path::new("/").join(canonical.strip_prefix("/private").unwrap());
Path::new("/").join(canonical.strip_prefix("/private").unwrap())
} else {
canonical
};
assert_eq!(canonical, file_path); assert_eq!(canonical, file_path);
Ok(()) Ok(())