How to do search in a file

Login to reply to this topic.
Wed, 2008-08-13 23:22
Joined: 2007-04-09
Forum posts: 28

How to search in a file, if the file size is BIG??
Example : If the file size is 2Mb
Puzzled


Thu, 2008-08-14 04:57
Joined: 2007-08-02
Forum posts: 26
Re: How to do search in a file

what do mean how does search depend on file size?. Can you elaborate more?.

Thu, 2008-08-14 06:33
Joined: 2007-04-09
Forum posts: 28
Re: How to do search in a file

I know an inefficient way.
1. Know the file size.
2. Instantiate an HBufC of that size.
3. Now just search it. [Now basically It is a search in the buffer]

But instead if I do not copy the whole file in a buffer, how can I search in a file??
Please help!! Sad

Thu, 2008-08-14 07:46
Joined: 2008-06-23
Forum posts: 85
Re: How to do search in a file

You can open a stream for the file and read just as many characters at a time as needed. Check out RFileReadStream.

  • Login to reply to this topic.