summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/aggregate.rs10
-rw-r--r--src/traverse.rs21
2 files changed, 24 insertions, 7 deletions
diff --git a/src/aggregate.rs b/src/aggregate.rs
index 101e45b..538950a 100644
--- a/src/aggregate.rs
+++ b/src/aggregate.rs
@@ -22,7 +22,17 @@ pub fn aggregate(
let mut num_roots = 0;
let mut aggregates = Vec::new();
let mut inodes = InodeFilter::default();
+ let paths: Vec<_> = paths.into_iter().collect();
+ let input_len = paths.len();
for path in paths.into_iter() {
+ // For now, bluntly ignore symlinks that are on the top-level, and there are more roots to follow
+ if input_len > 1 {
+ if let Ok(meta) = path.as_ref().symlink_metadata() {
+ if meta.file_type().is_symlink() {
+ continue;
+ }
+ }
+ }
num_roots += 1;
let mut num_bytes = 0u64;
let mut num_errors = 0u64;
diff --git a/src/traverse.rs b/src/traverse.rs
index a332088..c971bd1 100644
--- a/src/traverse.rs
+++ b/src/traverse.rs
@@ -78,7 +78,16 @@ impl Traversal {
// Also means that we will spin up a bunch of threads per root path, instead of reusing them.
walk_options.threads = num_cpus::get();
}
+ let input_len = input.len();
for path in input.into_iter() {
+ // For now, bluntly ignore symlinks that are on the top-level, and there are more roots to follow
+ if input_len > 1 {
+ if let Ok(meta) = path.symlink_metadata() {
+ if meta.file_type().is_symlink() {
+ continue;
+ }
+ }
+ }
let mut last_seen_eid = 0;
for (eid, entry) in walk_options
.iter_from_path(path.as_ref())
@@ -102,13 +111,11 @@ impl Traversal {
if walk_options.apparent_size {
m.len()
} else {
- data.name.size_on_disk_fast(m).unwrap_or_else(
- |_| {
- t.io_errors += 1;
- data.metadata_io_error = true;
- 0
- },
- )
+ data.name.size_on_disk_fast(m).unwrap_or_else(|_| {
+ t.io_errors += 1;
+ data.metadata_io_error = true;
+ 0
+ })
}
}
Some(Ok(_)) => 0,