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

Monitoring non-directory files #58

Open
kreichgauer opened this issue Aug 22, 2011 · 3 comments
Open

Monitoring non-directory files #58

kreichgauer opened this issue Aug 22, 2011 · 3 comments

Comments

@kreichgauer
Copy link
Collaborator

It took me some time to figure out that Observer.schedule only accepts path names pointing to a directory. The API Reference clearly states that it has to be a directory path, but the Quick Start guide could be more clear about it, and the Observer classes should probably raise an exception if you pass a non-directory file path.

@hbmartin
Copy link

Is there any way at all to monitor non-directory files?

@brutus
Copy link

brutus commented Jun 19, 2014

Took me quiet some time to figure out that monitoring non-directory files don't work o.O Is there any way to do this (despite watching the containing directory and filtering the wanted file, or polling manually for file changes)?

@oprypin
Copy link
Contributor

oprypin commented May 28, 2021

As far as I can tell, watchdog does not support passing a file's path to watch.
But actually with Linux, Mac and Polling emitters this seems to work by accident, but with Windows emitter it doesn't work (see also #769).

@BoboTiG could you make a statement whether Watchdog wants to support this use case?

Having that confirmation, maybe someone can solidify what already works by adding tests, and for the Windows emitter add some extra code to support this.

Alternatively, support for this can also be done generically, indeed by watching the parent directory like so:
08978b2 (mkdocs/mkdocs#2427)
Which is also perhaps code that could be integrated into Watchdog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants