title: C# - Is the size of a file have an influence on the write speed?
body: <p>I have a LogFile which log at a rhythm of (10MB/Hours) and this program need to run for the next 10+ Years. I need to decided at which size I create a new log file !</p>
  
  <p>I have compare the time to write in a 10KB File with the time for a 1GB+ file and the time are almost the same. </p>
  
  <p>Is the size of a file have an influence on the write speed,
  is it recommended to keep the size of a log file pretty small ? </p>
  
  <p>My C# Logging Function :</p>
  
  <pre><code>//LOGGING FUNCTION
  public static void Log(string LogInfo)
  {
      //FILE SIZE LIMITATION 50 000 000 Bytes, 50MB
      MaximumFileSize = 50000000
      long FileSize = 0;
  
      if (File.Exists("../Log/EventLog.txt"))
      {
          FileSize = new System.IO.FileInfo("../Log/EventLog.txt").Length;
      }
      if (File.Exists("../Log/EventLog.txt") &amp;&amp; (FileSize &gt; MaximumFileSize)) NewLog();
  
      if (!System.IO.Directory.Exists("../Log/")) System.IO.Directory.CreateDirectory("../Log/");
  
      using (StreamWriter s = File.AppendText("../Log/EventLog.txt"))
      {
          s.WriteLine(DateTime.Now.ToString() + " -- " + LofInfo);
          s.Close();
      }
  }
  
  //FUNCTION TO ARCHIVE LOG
  public static void NewLog()
  {
  
      if (File.Exists("../Log/EventLog.txt"))
      {
          File.Move("../Log/EventLog.txt", "../Log/EventLog_" + DateTime.Now.ToString("yyyyMMdd_HH_mm_ss") + ".txt");
      }
  
  }
  </code></pre>