How is it that hex editors like HIEW open exe files even 20 mb in size instantly?
Posted on 2001-08-03 11:14:12 by MovingFulcrum
Magic? :tongue:

Seriously, it is more likely that they open files incrementally.
If you read in a file 4k at a time, you can add it to your edit box in chunks and the user will see it as more or less immediate.

4k is a good size as its the minimum cluster size of the hdd.

Such a loading method is good as we humans are far too slow to spot it, the only problem is when the file is too big and you thrash the swap file!

Mirno
Posted on 2001-08-03 11:59:35 by Mirno
Then when i tell it go to an offset, how does it reach that too instantly even if the offset is right at the bottom of the file?
Posted on 2001-08-03 14:49:13 by MovingFulcrum
MF, it reaches the bottom instantaneously because it doesn't read
in the entire file, but just sets the file pointer to the end.

As for block sizes, you should use a multiple of 512, as that is the
harddrive sector size. Even better, use a multiple of 4096, as this
is the paging size, and pretty important in the disk cache system
(and so many other places in a 386+ OS :)).
Posted on 2001-08-03 15:04:02 by f0dder