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 0cc7319
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,13 @@ 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. (This is independent of the underlying
/// OS library used by notify.) 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 0cc7319

Please sign in to comment.