Hi,
I have written a polling service that checks a directory for new files & then distributes them to new locations.
The service is so quick, that no soon as the file has arrived in the watched folder, it is moved in to its new location.
One concern that I have is that the source files may take 10-15 seconds to be fully written to due to the amount of data being written out. I need to put a safe guard in place that checks that the file is not currently being written to before it gets moved.
Currently, my code simply does a quick naming convention check before executing the move code.
if(e.Name.StartsWith("Payfile1"))
I need to put inbetween this code and the code that moves the file a check to ensure the file is 'finished with' by the system that is writting it out.
Can anyone offer me any assistance on this?
Many thanks