Skip to content

Commit

Permalink
Explain how watch does not follow moves or renames
Browse files Browse the repository at this point in the history
This summarises the knowledge gathered from notify-rs#165 (comment)

Closes: notify-rs#165
  • Loading branch information
devurandom committed Sep 29, 2018
1 parent 676ee38 commit 8e45abc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,12 @@ pub trait Watcher: Sized {
///
/// If the `path` is a file, `recursive_mode` will be ignored and events will be delivered only
/// for the file.
///
/// If the `path` is renamed (moved) or deleted, it will automatically be unwatched. I.e. watch
/// does not follow moved directories or files. If at a later point another file or directory
/// is moved into the same location, it will not be automatically watched. If you need that
/// behaviour, it is recommended that you also watch the parent directory non-recursively and
/// implement an opportunistic watcher yourself.
fn watch<P: AsRef<Path>>(&mut self, path: P, recursive_mode: RecursiveMode) -> Result<()>;

/// Stop watching a path.
Expand Down

0 comments on commit 8e45abc

Please sign in to comment.