Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursively watch directories for changes #1

Closed
vendion opened this issue Apr 1, 2014 · 2 comments
Closed

Recursively watch directories for changes #1

vendion opened this issue Apr 1, 2014 · 2 comments

Comments

@vendion
Copy link

vendion commented Apr 1, 2014

Is it possible to have watchgopher recursively watch a directory for changes? For example if I have the following directory structure:

/home/user/directory
|
- /home/user/directory/subdir1
|
- /home/user/directory/subdir2

and watchgopher is told to watch the parent directory when a file gets created in subdir1 then watchgopher will take the same action that it would for the parent. I know I can add the subdirectories to the json config file and have the actions all the same, but parent directory I am working with has a lot of subdirectories and I would constantly have to make changes to the configuration.

@mrnugget
Copy link
Owner

mrnugget commented Apr 1, 2014

At the moment it is not possible to recursively watch a directory. The reason is that Watchgopher uses fsnotify (github.com/howeyc/fsnotify) to keep track of file changes and fsnotify itself doesn't support recursive watching. I didn't want to put that feature on top of fsnotify in watchgopher. If you want to hack on Watchgopher and add that feature: feel free to send a pull request, as I might not get around to it soon :)

Also check out this issue: howeyc/fsnotify#56 which contains a lot of useful information regarding that topic. Hint: os/notify is planned to be included in Go 1.4 and is based on howeyc/fsnotify.

@mrnugget mrnugget closed this as completed Apr 1, 2014
@vendion
Copy link
Author

vendion commented Apr 1, 2014

Thanks for getting back to me, I did not realize that it was a limitation
in fsnotify. I have subscribed to that issue and hope to see it
implemented in either howeyc/fsnotiy or os/notify in 1.4.

On Tue, Apr 1, 2014 at 3:41 PM, Thorsten Ball [email protected]:

Closed #1 #1.

Reply to this email directly or view it on GitHubhttps://github.com//issues/1
.

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

No branches or pull requests

2 participants