title: Why can't I append with R's write function
body: <p>Pardons if this has already been answered, I didn't see anything quite like this.  I want to create a running log but I can't get the write function to append.  Here is a sample:</p>
  
  <pre><code>fName &lt;- "D:/Temp/foo.txt"
  fCn &lt;- file(fName)
  write('test1', fCn, append = TRUE)
  write('test2', fCn, append = TRUE)
  close(fCn)
  </code></pre>
  
  <p>When I open the resulting file I only see the last line.  I have also tried opening and closing the file like so:</p>
  
  <pre><code>fCn &lt;- file(fName)
  write('test1', fCn, append = TRUE)
  close(fCn)
  
  fCn &lt;- file(fName)
  write('test2', fCn, append = TRUE)
  close(fCn)
  </code></pre>
  
  <p>Seems like it should be easy.  Where am I going wrong?  TIA</p>