From 650e92ad5f4656c6764aa3988b95eff8954116af Mon Sep 17 00:00:00 2001 From: licsber Date: Thu, 5 Feb 2026 23:50:59 +0800 Subject: [PATCH] fix --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/meta/tree.rs | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aebd80f..b677335 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -236,7 +236,7 @@ dependencies = [ [[package]] name = "l-s" -version = "0.4.0" +version = "0.4.1" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index c75291b..585e62f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "l-s" -version = "0.4.0" +version = "0.4.1" authors = ["licsber "] edition = "2021" diff --git a/src/meta/tree.rs b/src/meta/tree.rs index 095c469..7d7c94d 100644 --- a/src/meta/tree.rs +++ b/src/meta/tree.rs @@ -59,6 +59,10 @@ impl DirSnapshot { .file_type() .with_context(|| format!("无法读取类型: {}", full_path.display()))?; + if file_type.is_symlink() { + continue; + } + if file_type.is_dir() { if should_skip_dir(&name) { continue; @@ -141,6 +145,10 @@ fn count_files_recursive(path: &Path, count: &mut u64) -> Result<()> { .file_type() .with_context(|| format!("无法读取类型: {}", full_path.display()))?; + if file_type.is_symlink() { + continue; + } + if file_type.is_dir() { if should_skip_dir(&name) { continue; @@ -175,6 +183,10 @@ fn walk_dir_with_progress( .file_type() .with_context(|| format!("无法读取类型: {}", full_path.display()))?; + if file_type.is_symlink() { + continue; + } + if file_type.is_dir() { if should_skip_dir(&name) { continue;