title: append NSString to file atomically?
body: <p>some functions to write files are atomic and therefore quite convenient in the sense that they prevent file corruption should something happen at write-time.</p>
  
  <pre><code>-[NSData writeToFile:atomically:]
  -(BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile encoding:(NSStringEncoding)enc error:(NSError **)error;
  </code></pre>
  
  <p>the problem is that they erase the file and replace it with the new content… And I need to just append one line  to a huge file.</p>
  
  <p>What is the best way to do that in an atomic way, not risking to corrupt that file should something happen?</p>
  
  <p>PS: the file is too huge to read it in one string, update the string and then push the enormous string to the file system.</p>
  
  <p>Thanks in advance.</p>