How to write file in Symbian


At first you have to include

#include

Which links against efsrv.lib

Then try the code snippet

RFs fSession;
User::LeaveIfError(fSession.Connect());
RFile file;
TInt ret = file.Open(fSession, _L("C:\\testFile.txt"), EFileWrite);
if (ret)
{
ret = file.Create(fSession, _L("C:\\testFile.txt"), EFileWrite);
}
if (!ret)
{
file.Write(_L8("Write some data"));
}
file.Close();
fSession.Close();

Now find your file in this location:

C:\S60\devices\S60_3rd_FP2_SDK_v1.1_2\epoc32\winscw\c

If you unable to find it as I didn’t can search whole C drive for the location.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s