This commit is contained in:
2026-02-05 23:50:59 +08:00
parent 6943ac8ef5
commit 650e92ad5f
3 changed files with 14 additions and 2 deletions

2
Cargo.lock generated
View File

@@ -236,7 +236,7 @@ dependencies = [
[[package]] [[package]]
name = "l-s" name = "l-s"
version = "0.4.0" version = "0.4.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "l-s" name = "l-s"
version = "0.4.0" version = "0.4.1"
authors = ["licsber <admin@licsber.site>"] authors = ["licsber <admin@licsber.site>"]
edition = "2021" edition = "2021"

View File

@@ -59,6 +59,10 @@ impl DirSnapshot {
.file_type() .file_type()
.with_context(|| format!("无法读取类型: {}", full_path.display()))?; .with_context(|| format!("无法读取类型: {}", full_path.display()))?;
if file_type.is_symlink() {
continue;
}
if file_type.is_dir() { if file_type.is_dir() {
if should_skip_dir(&name) { if should_skip_dir(&name) {
continue; continue;
@@ -141,6 +145,10 @@ fn count_files_recursive(path: &Path, count: &mut u64) -> Result<()> {
.file_type() .file_type()
.with_context(|| format!("无法读取类型: {}", full_path.display()))?; .with_context(|| format!("无法读取类型: {}", full_path.display()))?;
if file_type.is_symlink() {
continue;
}
if file_type.is_dir() { if file_type.is_dir() {
if should_skip_dir(&name) { if should_skip_dir(&name) {
continue; continue;
@@ -175,6 +183,10 @@ fn walk_dir_with_progress(
.file_type() .file_type()
.with_context(|| format!("无法读取类型: {}", full_path.display()))?; .with_context(|| format!("无法读取类型: {}", full_path.display()))?;
if file_type.is_symlink() {
continue;
}
if file_type.is_dir() { if file_type.is_dir() {
if should_skip_dir(&name) { if should_skip_dir(&name) {
continue; continue;