EControl Ltd. Forum Index EControl Ltd.
VCL libraries and software support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question about open a BIG file

 
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor
View previous topic :: View next topic  
Author Message
sepa



Joined: 06 May 2007
Posts: 13

PostPosted: Tue May 08, 2007 7:10 pm    Post subject: Question about open a BIG file Reply with quote

Hi.
Can i somehow open a files about 1-4Gb size in this component? (with 512Mb RAM =) It's need to use memory mapping? or read file by parts of 64k for example, and redraw position and size of scrollbar accordingly. It's not needed true syntax coloring in this case (analizing of whole file). I agreed with analizing/coloring of currently loaded/displayed part of file. But how to manipulate scrollbar?
I'm in start of path, and want to ask, which ways usually used for solution.
Can you give me some keywords, so i can read more about in internet?
Thnx.
Back to top
View user's profile Send private message Visit poster's website
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Tue May 08, 2007 10:48 pm    Post subject: Reply with quote

Hello,

This component is not intended for such big files. All text is loaded to memory.
Using file-mapping is impossible, but partial loading is more realistic.

Possible implementation (for read-only):
1. Calculate line count and their positions in file (scan file by reading bytes, for this operation you may use file-mapping)
2. Initilize memo with empty lines.
3. Trace vertical scroll position to load visible lines plus surrounded lines (to minimize number of loading).

To implement editing you may store changed lines separetly and when loading portion of text take these lines instead of unchanged lines.

Michael.
Back to top
View user's profile Send private message Send e-mail
sepa



Joined: 06 May 2007
Posts: 13

PostPosted: Wed May 09, 2007 6:37 am    Post subject: Reply with quote

Thank you for fast answer. I'll try to implement this way
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group