From ab043d2e6482117fd2c3975b025f6f167cce2893 Mon Sep 17 00:00:00 2001 From: Nora Date: Sun, 9 Jun 2019 15:52:42 +0200 Subject: follow symlinks in all file accesses --- src/actions/index/action.rs | 4 +++- src/utils/fileutil.rs | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/actions/index/action.rs b/src/actions/index/action.rs index ffbe4f8..b32a248 100644 --- a/src/actions/index/action.rs +++ b/src/actions/index/action.rs @@ -80,7 +80,9 @@ fn index_dir(dir: &Path, reindex: bool) -> KhResult<()> { pub fn get_ics_files(dir: &Path, modified_since: i64) -> impl Iterator { use walkdir::WalkDir; - WalkDir::new(dir).into_iter() + WalkDir::new(dir) + .follow_links(true) + .into_iter() .filter_entry(move |entry| accept_entry(entry, modified_since)) .filter_map(|e| e.ok()) .filter(|e| e.file_type().is_file()) diff --git a/src/utils/fileutil.rs b/src/utils/fileutil.rs index 04d3796..a655f42 100644 --- a/src/utils/fileutil.rs +++ b/src/utils/fileutil.rs @@ -9,7 +9,9 @@ use crate::icalwrap::IcalVCalendar; pub fn file_iter(dir: &Path) -> impl Iterator { use walkdir::WalkDir; - WalkDir::new(dir).into_iter() + WalkDir::new(dir) + .follow_links(true) + .into_iter() .filter_map(|e| e.ok()) .filter(|e| e.file_type().is_file()) .map(|entry| entry.into_path()) @@ -19,7 +21,9 @@ pub fn dir_iter(dir: &Path) -> impl Iterator { use walkdir::WalkDir; let dir = dir.to_path_buf(); - WalkDir::new(&dir).into_iter() + WalkDir::new(&dir) + .follow_links(true) + .into_iter() .filter_map(|e| e.ok()) .filter(|e| e.file_type().is_dir()) .filter(move |f| f.path() != dir) -- cgit v1.2.3