We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4395a30 commit aecda39Copy full SHA for aecda39
tests/fs_additional.rs
@@ -402,3 +402,18 @@ fn dir_searchable_unreadable() {
402
.create_dir_with("dir/writeable_subdir", &options)
403
.is_err());
404
}
405
+
406
+/// POSIX says that whether or not `link` follows symlinks in the `old`
407
+/// path is implementation-defined. We want `hard_link` to not follow
408
+/// symbolic links.
409
+#[test]
410
+fn symlink_hard_link() {
411
+ let tmpdir = tmpdir();
412
413
+ check!(tmpdir.create("file"));
414
+ check!(symlink_file("file", &tmpdir, "symlink"));
415
+ check!(tmpdir.hard_link("symlink", &tmpdir, "hard_link"));
416
+ let _ = check!(tmpdir.open("hard_link"));
417
+ check!(tmpdir.rename("file", &tmpdir, "file.renamed"));
418
+ assert!(tmpdir.open("hard_link").is_err());
419
+}
0 commit comments