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.
-[NSData writeToFile:atomically:]
-(BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile encoding:(NSStringEncoding)enc error:(NSError **)error;
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.
What is the best way to do that in an atomic way, not risking to corrupt that file should something happen?
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.
Thanks in advance.