I have to write a Plugin, which is called from another component. The plugin should look for files in a given network share and if there are new files, they should be copied elsewhere.
Unfortunately when there are bigger files, it can happen that my plugin is called before the file writing to the source directory is complete, which means that I'm copying just a part of the file.
I found solutions to watch the process who writes the file or use FileWatcher to watch the directory, but since I'm copying from a network share and my plugin is called from the outside, this wouldn't work for me - would it?
I have to guarantee that the files I can find within the network share are complete. Is there something like a check, if all bytes are written or something like that?`
Thanks in advance