Read a .txt file in Symbian


If you want to read a file and display that on alert screen the following code snippet will do that for you.

TBuf8<128> rcvr;
TBuf<128> tDsply;
RFs fSessionRd;
User::LeaveIfError(fSessionRd.Connect());
RFile fileRd;
TInt retRd=fileRd.Open(fSessionRd, _L("C:\\testFile.txt"), EFileRead);

if(!retRd){
fileRd.Read(rcvr);
tDsply.Copy(rcvr);
iEikonEnv->AlertWin(tDsply);
}

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 )

Google+ photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s