From d9e3e7bf3b3b06eae2e43e9eccf33d3281f913cb Mon Sep 17 00:00:00 2001 From: Sakurai Date: Mon, 12 Aug 2024 12:46:55 +0900 Subject: [PATCH] =?UTF-8?q?#3=20=E3=81=AE=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IO/LocalStore.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/IO/LocalStore.cs b/IO/LocalStore.cs index f0fd036..7395d5b 100644 --- a/IO/LocalStore.cs +++ b/IO/LocalStore.cs @@ -29,6 +29,9 @@ public class LocalStore : IStore using (FileStream fs = new FileStream(this.filePath, FileMode.OpenOrCreate)) using (StreamWriter writer = new StreamWriter(fs, DefaultEncoding)) { + fs.Seek(0, SeekOrigin.Begin); + fs.SetLength(0); + foreach (T item in this.items) { string json = JsonSerializer.Serialize(item);