A log writing project has been created over the past few days, and the append method is used to write log files.
After investigation, the SDK found that such a function is not encapsulated in Symbian.
Therefore, you can only get your own clothes and food
The specific implementation process is as follows:
Symbian rfilewritestream and rfile read and write files in append Mode
Rfile file; <br/> // create the file for writing <br/> tint err = file. open (ccoeenv: static ()-> fssession (), kfile, efilewrite ); <br/> // file does not exist-create it <br/> If (ERR = kerrnotfound) <br/> err = file. create (ccoeenv: static ()-> fssession (), kfile, efilewrite); <br/> rfilewritestream writer; <br/> tint ifilesize = 0; <br/> file. size (ifilesize); <br/> writer. attach (file, ifilesize); <br/> writer. writel (createbuf); // write the content of timebuf to the stream <br/> writer. commitl (); // submit, equivalent to flush <br/> writer. close ();
It is mainly to first obtain the file size through the rfile: size function, and then locate it at the end of the file through the rfilewritestream: attach function.
This allows you to read and write files by append.