Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9841


Ignore:
Timestamp:
08/02/13 15:28:44 (11 years ago)
Author:
mkommend
Message:

#2081: Changed FileShare to read / write for file reloading.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data.Views/3.3/Path Views/TextFileView.cs

    r9833 r9841  
    216216      if (!File.Exists(path)) return null;
    217217      string fileContent = string.Empty;
    218       using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) {
     218      using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) {
    219219        using (StreamReader streamReader = new StreamReader(fileStream)) {
    220220          fileContent = streamReader.ReadToEnd();
     
    225225
    226226    private static void WriteFile(string path, string fileContent) {
    227       using (FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.Write)) {
     227      using (FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None)) {
    228228        using (StreamWriter streamWriter = new StreamWriter(fileStream)) {
    229229          streamWriter.Write(fileContent);
Note: See TracChangeset for help on using the changeset viewer.