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

silently fails if path is file #1034

Open
avelican opened this issue Feb 25, 2024 · 3 comments
Open

silently fails if path is file #1034

avelican opened this issue Feb 25, 2024 · 3 comments

Comments

@avelican
Copy link

Having written my code in a rush, I set the path to be a file rather than a directory.
The code runs without warnings or errors, but fails to report modifications to the file.
It seems watchdog supports only monitoring directories, not individual files.

I suggest watchdog should either:
A) support events on a single file (perhaps this can be done simply by monitoring its directory and ignoring changes on everything that isn't that file)
This solution seems more ergonomic from user POV.
Alternatively,
B) If given path is file, throw an exception and say it must be a directory

(Please forgive me if I've overlooked something, I haven't had time to take a proper look at how watchdog works yet.)

@BoboTiG
Copy link
Collaborator

BoboTiG commented Feb 26, 2024

What OS?

@LeStahL
Copy link

LeStahL commented Mar 19, 2024

I see this behavior on Windows 11 as well.

@prshir
Copy link

prshir commented Mar 31, 2024

Could you post your code to reproduce the silent fail?
I tried to reproduce specifying file rather than a directory and then changing it. Watchdog once printed Deleted directory: and my path to file. Not sure if it's a correct behavior but at least it doesn't fail. When I changed the file observed nothing happened.

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

4 participants