DirectoryWatchdog
DirectoryWatchdog copied to clipboard
Get notified after file is fully written
Hi. I'm using your library and it's being very useful to me but there's something that it's keeping me from complete my project.
When I observe a folder for changes and I copy a file to the directory it turns that your library triggers its update block before the file is fully copied, so when I try to modify the file it fails. I don't know if it is even possible but is there any way I could be notified once the file operation has ended?
Thank you very much.
R.M.
Sorry I looked at the manual for the kqueue events, and I can't really give you a clear answer here.
According to the kqueue manpage and this example you could try change the event type by replacing EVFILT_VNODE
with EVFILT_READ
.
Haven't tried it but this might work:
On line 104 change the filter
value to EVFILT_READ
and set the fflags field to 0 (Or just comment out the line).
Thank you very much for your answer. I'll try and I'll give feedback
Well. I wasn't able to make it work. Still trying. Thanks for your help.