I am trying to read a file on a timely basis the moment an edit or creation occurs. There is another piece of hardware that creates files to a folder which i wish to access (on a timely basis).
How does one go about detecting the creation a newly edited or created file using C# .net. I do not want to poll the folder on a periodic basis as the machine could potentially write several times in between the polling time interval. i.e. I want to avoid:
- File 1 (created) 10:00:04AM
- Poll file 1 ( no data lost ) 10:00:05AM
- File 1 (overwritten with new data) 10:00:07AM
- Poll File 1 ( no data lost ) 10:00:10AM
- File 1 (overwritten with new data) 10:00:12AM
- File 1 (overwritten with new data) 10:00:14AM
- Poll File 1 ( 10:00:12AM data lost) 10:00:15AM