diff --git a/src/lib.rs b/src/lib.rs index e56f5f4..4d8db7b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,6 +58,13 @@ pub fn get_absolute_path(path: &str) -> Option { fs::canonicalize(path).ok() } +pub fn is_symlink(path: &Path) -> bool { + match path.symlink_metadata() { + Err(_) => false, + Ok(meta) => meta.file_type().is_symlink(), + } +} + pub fn walk_dir(dir: &Path, func_walk_error: &FError, func_process_file: &FProcess,