-
Notifications
You must be signed in to change notification settings - Fork 681
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
Watchdog on windows is not working properly. #158
Comments
I took a brief look at it and saw that the solution you tried for the "knowing if it was a dir to be deleted" was you keep the dir tree in memory. Though since those look like to be just paths that doesn't sound like it eats up that much memory on average. I wonder if there isn't any way to coax that info out of Windows itself? As for missing events, could you outline which ones are not there, as in why is your approach guaranteed to have fewer of those? One way to get this into tree might be to fix whatever is causing missing files in the current approach, and maybe have the "is this event a dir delete or file delete" as an optional thing you can turn on for extra accuracy. As for how it could be used from watchdog as a backend from a src code POV you'd need to implement the Observer class. |
Knowing if the object was a file or directory:About the information about the Directory was deleted, I just spent a couple of weeks on msdn and viewing other implementations of micrsosoft in .NET, and windows will never tell you if the file object was a directory. behavior differencesthe differences of watching directories in windows and other systems are: in windows when you move the file between directories, windows will act as the file was deleted then recreated into another place (there is a workaround by checking the mactimes of the deleted file and the new created file.) when you move a file from outside the repository to the repository, the file will act as a created. about of the internal tree, there is another way using CreateShadowCopy, in this way, you can create instantly a shadow backup that DON`T spend more space in disk neither will fail because exclusive access to files, to check the type of files, but it is very a complicated thing to do. in the tests, i take a several stress test to make sure that no event will be lost. Observer Classthere is any documentation how to implement an observer class? |
Rather than implementing another observer class the current one should be fixed. It's all the same windows api right. The low level win api code is in winapi.py. The mapping of raw windows events into the cross platform ones happens in read_directory_changes.py. Specifically in Like you say there are several known issues with the windows code so patches are much appreciated. |
Ok, but in this case, at the time I wrote the backend, i was very Em 07-05-2013 10:21, takoi escreveu:
|
What we should do? That will be up to you or whoever wants to. I don’t have any windows machine available and can't help with that. There's nobody currently responsible for the windows part if that's what you're asking. The original developer of it is long gone. |
I can mantain the windows backend, i have no machine with windows too, but i have VMs and I've been using win32api for more than 15 years. |
looks like my problem is the same: just renamed subdirectory in watched directory and got FileMovedEvent with event.is_directory = False. |
I think we should make this two specific issues: Because so far as I can tell, for both of these, this is more or less just the design of Windows: |
hm probably reading USN may be helpful. it seems usn records have some additional identification info |
Were some or all of the problems described in this issue fixed by #195? |
No, this is about |
In windows, watchdog is leaving events in the wrong form. sometimes a directory is deleted, and watchdog tells a file file was deleted instead.
many events are not catch by watchdog.
i just made a filewatcher for windows using ctypes that watchdog could use as backend on windows:
https://github.com/caetanus/windows-file-changes-notify
if you appreciate and tells me how, i can put myself it as backend on watchdog, but feel free if you want.
thankyou
The text was updated successfully, but these errors were encountered: