Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/uu/tail/src/follow/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ impl Observer {

let event_path = event.paths.first().unwrap();
let mut paths: Vec<PathBuf> = vec![];

// If the path is not being tracked, ignore this event.
// This can happen when --follow=descriptor is used without --retry,
// and a file that initially didn't exist is created in a watched directory.
if !self.files.contains_key(event_path) {
return Ok(paths);
}

let display_name = self.files.get(event_path).display_name.clone();

match event.kind {
Expand Down
Loading