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 :
I then use the Compare() function to compare the string read with a predefined value .
RFs sessionhandle ;
RFile file ;
TBuf8 <30> buf ; //**********Using a TBuf8**********
//Read the text into a buffer
User::LeaveIfError(file.Read(buf)); //buf now contains the text from the file
Again, thanks for showing me another way to make it work