mirror of
https://gitee.com/openharmony/third_party_rust_which-rs
synced 2025-02-17 05:18:49 +00:00
Merge pull request #23 from fdncred/patch-1
Allow checker to support reparsepoints in Windows
This commit is contained in:
commit
209804c363
@ -39,6 +39,14 @@ impl ExistedChecker {
|
||||
}
|
||||
|
||||
impl Checker for ExistedChecker {
|
||||
#[cfg(target_os="windows")]
|
||||
fn is_valid(&self, path: &Path) -> bool {
|
||||
fs::symlink_metadata(path)
|
||||
.map(|metadata| metadata.is_file())
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
#[cfg(not(target_os="windows"))]
|
||||
fn is_valid(&self, path: &Path) -> bool {
|
||||
fs::metadata(path)
|
||||
.map(|metadata| metadata.is_file())
|
||||
|
Loading…
x
Reference in New Issue
Block a user