Hi ! Eswar ,
Thanks a lot for replying
.After I posted the problem I tried a few things and actually got it to work
by using a different approach that involves using a TBuf instead of HBufC that you have used.
My code is as follows :
Code:
RFs sessionhandle ;
RFile file ;
User::LeaveIfError(sessionHandle.Connect());
_LIT(KFile,"c:\\system\\apps\\format.txt");
TBuf8 <30> buf ; //**********Using a TBuf8**********
User::LeaveIfError(file.Open(sessionHandle,KFile,EFileRead));
//Read the text into a buffer
User::LeaveIfError(file.Read(buf)); //buf now contains the text from the file
file.Close();
sessionHandle.Close();
I then use the Compare() function to compare the string read with a predefined value
.
Again, thanks for showing me another way to make it work