title: Notepad .LOG only saves log time when opened manually
body: <p>I have a text file that begins with <em>.LOG</em> inside and each time I manually edit the file and save, the edit time gets logged.</p>
  <p>I tried replicating the same concept using StreamWriter, however the edit time no longer gets logged. The time is logged only when I update the file manually. What could be the reason for this?</p>
  <p>My Code:</p>
  <pre><code>StreamReader reader = new StreamReader(&quot;log.txt&quot;);
  string myText = reader.ReadToEnd();
  reader.Close();
  
  StreamWriter writer = new StreamWriter(&quot;log.txt&quot;);
  writer.WriteLine(myText+ Environment.NewLine+&quot;Automated Test&quot;);
  writer.Flush();
  write.Close();
  </code></pre>
  <p>Screenshot:</p>
  <p><a href="https://i.stack.imgur.com/jbTWw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jbTWw.png" alt="Log File" /></a></p>