DirectoryWatchdog icon indicating copy to clipboard operation
DirectoryWatchdog copied to clipboard

Get notified after file is fully written

Open rmvz3 opened this issue 8 years ago • 3 comments

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.

rmvz3 avatar May 30 '16 01:05 rmvz3

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_VNODEwith 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).

graetzer avatar May 30 '16 14:05 graetzer

Thank you very much for your answer. I'll try and I'll give feedback

rmvz3 avatar May 30 '16 18:05 rmvz3

Well. I wasn't able to make it work. Still trying. Thanks for your help.

rmvz3 avatar May 31 '16 03:05 rmvz3