×
Namespaces

Variants
Actions

How to append data to file in Symbian c++

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: vasant21 (03 Jan 2008)
Last edited: hamishwillee (26 Jul 2012)

This example shows appending data to some existing file.


_LIT8(KData,"This is an example data");
RFs fsSession;
User::LeaveIfError( fsSession.Connect() );
 
RFile file;
TInt err = file.Open(fsSession, KFileName, EFileWrite );
 
if(err == KErrNone) {
// File opened successfully now append data to file
 
// Find the end of the file
TInt pos = 0;
err = file.Seek( ESeekEnd, pos );
if( err == KErrNone ) {
file.Write(pos, KData);
}
file.Close();
}
 
fsSession.Close();





This page was last modified on 26 July 2012, at 06:10.
54 page views in the last 30 days.