Skip to content

Commit

Permalink
Merge pull request #23 from fdncred/patch-1
Browse files Browse the repository at this point in the history
Allow checker to support reparsepoints in Windows
  • Loading branch information
harryfei authored Jun 22, 2020
2 parents 1df9b0e + 8c3bfca commit 209804c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 209804c

Please sign in to comment.