Skip to content

Single file support for inotify#22

Merged
passcod merged 3 commits intonotify-rs:masterfrom
Yuhta:inotify-single-file
Jul 12, 2015
Merged

Single file support for inotify#22
passcod merged 3 commits intonotify-rs:masterfrom
Yuhta:inotify-single-file

Conversation

@Yuhta
Copy link
Contributor

@Yuhta Yuhta commented Jul 11, 2015

Fix #16

@passcod
Copy link
Member

passcod commented Jul 11, 2015

Great work! Is inotify the only one that needs this, or do the others (polling) also need patching up?

Add yourself to the authors array in the Cargo.toml :)

@maurizi Not sure if your work on the Windows implementation supports single file watching, is it possible, harder, easy ? Just to let you know we're apparently going to support that now.

@Yuhta
Copy link
Contributor Author

Yuhta commented Jul 11, 2015

Patched and added PollWatcher; I don't have the environment to test FsEventWatcher but some one else can easily add it.

@maurizi
Copy link
Contributor

maurizi commented Jul 11, 2015

@passcod Windows only really has a notion of watching directories, so this will be harder on Windows, since we'll have to add a layer above this that filters out events not for that file. Since it looks like PollWatcher will need that as well, it might be a good idea to implement it generically.

@passcod
Copy link
Member

passcod commented Jul 12, 2015

I'm going to merge this to fix #16. FS watchers in general seem to only support watching folders, with exceptions.

So we'll have to figure an internal API, perhaps with traits, so a backend could:

  • implement a FileWatcher to watch individual files, so we'd have to recurse to watch everything, or
  • implement a DirWatcher to watch individual folders, so we'd have to recurse to watch subfolders, or
  • implement a RecursiveDirWatcher to watch everything, or
  • any combination of the above

and then Notify itself would take care of wrangling each backend to provide the same public API.

passcod added a commit that referenced this pull request Jul 12, 2015
Single file support for inotify and poll
@passcod passcod merged commit 2c80db4 into notify-rs:master Jul 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants