seek and write to hard disk blocks

Hi All,

Please help if anyone knows if I can do the following and how?

I have an extremely large file in a fixed format stored in a hard disk. I want to write a code that can do update a portion of the big file without read in and write out the entire file. For example of the following file, I want to go to location 5 on the hard disk and replace only the content EE to ZZ without rewrite the entire file.
1 AA
2 BB
3 CC
4 DD
5 EE ->ZZ
6 FF
7 GG
8 HH
9 II
.. ..


Thanks,
Po
What you want is called a file map or file view or some minor variation of that name. What platform are you on? What libraries (if any) are you already using or comfortable enough to us?

EDIT: I should point out that in reality the solution that I am proposing is not as low level as you want. But it has what you are looking for, that is not loading the entire file into memory. In most modern OS's you can't actually do what you are asking because the OS doesn't write to the HDD platter; that is up to the HDD's controller which you are isolated from.
Last edited on
Topic archived. No new replies allowed.