I am working on a application which reads a file and after processing saves it back. I have to keep file in a stream while the file is in the processing. Now the issue is that I have to minimize the LOCK time of the file.
What is the solution?
I am working on a application which reads a file and after processing saves
Share
I would recommend you to keep your file in
MemoryStream. When you write to aMemoryStream, the data is stored in memory instead of being stored to the file system. After the processing you can then callMemoryStream.WriteToto store the data on the file system permanently. This will minimize the lock time.