I am having an issue where I am writing to a file at the same time other's are manually reading/writing to the file. I would like to lock the file so that all open instances become read-only once FileStream is called.
FileStream fsFile = new FileStream(stFilePath, FileMode.Append, FileAccess.Write, FileShare.Read);
Will the FileShare.Read attribute prevent manual changes being saved if the text file is open PRIOR to FileStream being called?