diff options
| author | bors <bors@rust-lang.org> | 2016-02-04 18:48:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-02-04 18:48:41 +0000 |
| commit | d0ef74026690cffccb543fc274d73a078eba797d (patch) | |
| tree | 53b22502b696e336d3ee7ae6a722fbdbfda77053 /src/libstd/sys/unix/stack_overflow.rs | |
| parent | f01b85b1034889888be65d2208640ac926a42d36 (diff) | |
| parent | fb172b676e5ab951e58b98cede795ab1a7557a58 (diff) | |
| download | rust-d0ef74026690cffccb543fc274d73a078eba797d.tar.gz rust-d0ef74026690cffccb543fc274d73a078eba797d.zip | |
Auto merge of #31360 - pitdicker:fs_tests_cleanup, r=alexcrichton
- use `symlink_file` and `symlink_dir` instead of the old `soft_link`
- create a junction instead of a directory symlink for testing recursive_rmdir (as it causes the
same troubles, but can be created by users without `SeCreateSymbolicLinkPrivilege`)
- `remove_dir_all` was unable to remove directory symlinks and junctions
- only run tests that create symlinks if we have the right permissions.
- rename `Path2` to `Path`
- remove the global `#[allow(deprecated)]` and outdated comments
- After factoring out `create_junction()` from the test `directory_junctions_are_directories` and
removing needlessly complex code, what I was left with was:
```
#[test]
#[cfg(windows)]
fn directory_junctions_are_directories() {
use sys::fs::create_junction;
let tmpdir = tmpdir();
let foo = tmpdir.join("foo");
let bar = tmpdir.join("bar");
fs::create_dir(&foo).unwrap();
check!(create_junction(&foo, &bar));
assert!(bar.metadata().unwrap().is_dir());
}
```
It test whether a junction is a directory instead of a reparse point. But it actually test the
target of the junction (which is a directory if it exists) instead of the junction itself, which
should always be a symlink. So this test is invalid, and I expect it only exists because the
author was suprised by it. So I removed it.
Some things that do not yet work right:
- relative symlinks do not accept forward slashes
- the conversion of paths for `create_junction` is hacky
- `remove_dir_all` now messes with the internal data of `FileAttr` to be able to remove symlinks.
We should add some method like `is_symlink_dir()` to it, so code outside the standard library
can see the difference between file and directory symlinks too.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
