Open file continuously

A file is opened or closed on a command. Windows or any operating system does not automatically close, an open file. Given this, when you open a file it remains open. In your case, you appear to be opening a graph and I assume you want that graph to refresh itself based on some criteria such as read from a file, collect its data, add it to your graph and refresh it. In other words, a live update to the graph. If not, can you elaborate?

If yes, then have you considered adding a trigger that would look for a “new file” in a location and starting a process that would read and update your graph?

Hi @mitul_choudhary , Please use lock file mechanism.
Create filestream variable

FileStream fileStream = new FileStream(file, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read);