title: Working with .tmp file for writing data
body: <p>I'm wondering if there is a best practice when it comes to working with .tmp file for writing data. I like to make an .tmp that will be use in the filestream and then when I close the writer, I like to rename the file. Is there a way to rename file extension?</p>
  
  <pre><code>    FileStream stream2 = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite);
      StreamWriter streamWriter2 = new StreamWriter(stream2);
      streamWriter2.WriteLine(textToAdd);
      streamWriter2.Close();
      string changed = Path.ChangeExtension(fileName, .txt);
      File.Move(path, changed);
  </code></pre>