Problem with RFile

Login to reply to this topic.
Thu, 2008-05-15 20:16
Joined: 2006-11-22
Forum posts: 73

Hi To All,

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.

Thanks.


Thu, 2008-05-15 21:07
Forum Nokia Champion
Joined: 2006-10-12
Forum posts: 463
Re: Problem with RFile
Thu, 2008-05-15 22:39
Joined: 2003-12-05
Forum posts: 588
Re: Problem with RFile

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.

Fri, 2008-05-16 06:50
Joined: 2007-08-02
Forum posts: 24
Re: Problem with RFile

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.

Fri, 2008-05-16 07:23
Joined: 2003-12-05
Forum posts: 588
Re: Problem with RFile

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.

Fri, 2008-05-16 09:06
Joined: 2007-09-15
Forum posts: 61
Re: Problem with RFile

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().

Sun, 2008-05-18 08:04
Joined: 2006-11-22
Forum posts: 73
Re: Problem with RFile

Hey Thanks to all of you
i am going to try this and will get back with the result

Mon, 2008-05-19 10:47
Joined: 2008-04-23
Forum posts: 35
Re: Problem with RFile

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

  • Login to reply to this topic.