Skip to content

Commit

Permalink
DeleteLogsDirIfExists を再度有効化&ログファイルの削除を許可
Browse files Browse the repository at this point in the history
  • Loading branch information
Takym committed Jun 11, 2021
1 parent 1fd2885 commit 9cef515
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Covid19Radar/Covid19Radar/Services/Logs/LogWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ internal LogFile(string path, Encoding enc)

private StreamWriter OpenFile()
{
return new StreamWriter(new FileStream(this.Path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite), _encoding) {
return new StreamWriter(new FileStream(this.Path, FileMode.Append, FileAccess.Write, FileShare.ReadWrite | FileShare.Delete), _encoding) {
AutoFlush = true
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ private IEssentialsService CreateDefaultMockIEssentialsService()

private StreamReader OpenReader(string path)
{
return new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));
return new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete));
}

private void RecreateLogsDir()
Expand All @@ -734,13 +734,11 @@ private void RecreateLogsDir()

private void DeleteLogsDirIfExists()
{
/*
var logsDirPath = "~/.cocoa/logs";
if (Directory.Exists(logsDirPath))
{
Directory.Delete(logsDirPath, true);
}
//*/
}

private void RecreateLogsFile()
Expand Down

0 comments on commit 9cef515

Please sign in to comment.