I am using RFile to create a txt file and writing some data in this when i write second time in my file it overwrite the previous data .
I want to add my data with previous one Please tell me how can i do this.
Seeking can be done as given the above example, one more thing is that make sure when you are reopening your file, open it with RFile::Open() method rather than the RFile::Replace() method().
you can overcome this problum. Go to your SDK and
See this function Seek(TSeek aMode, TInt &aPos) and
use this Enum ESeekEnd.
means frist open your file and then use Seek function.
i hope you will understand.
Forum posts: 463
See if this helps
http://wiki.forum.nokia.com/index.php/Reading_and_writing_files
Forum posts: 588
No it doesn't help. It doesn't show how to use RFile::Seek to go to the end of file to add content to previously created file.
Forum posts: 24
I think the easy way would be to use.
TInt pos;
RFile::Seek( ESeekEnd,pos );
and then write normally to the file.
Hope it was useful.
Forum posts: 588
Sligthly useful example, but not fully, since that code doesn't compile -- seek is not a class (static) method.
But I'm sure sulabh120881 manages to get it working since he (she?) already has working code using RFile.
Forum posts: 61
Hi Sulabh
Seeking can be done as given the above example, one more thing is that make sure when you are reopening your file, open it with RFile::Open() method rather than the RFile::Replace() method().
Forum posts: 73
Hey Thanks to all of you
i am going to try this and will get back with the result
Forum posts: 35
Hi,
you can overcome this problum. Go to your SDK and
See this function Seek(TSeek aMode, TInt &aPos) and
use this Enum ESeekEnd.
means frist open your file and then use Seek function.
i hope you will understand.
thanks.
ravinder singh rawat