This is a very inefficient way of writing/reading to/from files. You have to use asynchronous operations to do read/write files.
You have to use Seek() to position file cursor at the end of the file if you do not want to get the data at the begining overwritten.
Application may need to save some text data on client. Flat text file is more suitable in storing large data. Creating a text file and saving text data, in it for later use, is good option. Reading and writing text file is basic operation to use text file. RFile is key API to read/write data from/in file.
The article describes methods to read data from text file and write data to a text file. This article use synchronous method RFile::Read() and RFile::Write() to read/write data in file, However if content of text file is large then it is recommended to use asynchronous method RFile::Read() and RFile::Write().
--kamlesh sangani 11:30, 16 September 2009 (UTC)