You are not logged in.
Pages: 1
Hello, do you know if this is possible (doesn't matter what language..):
If I have a big file which is much larger that my memory + swap space, say 20gb. Is it possible to say something like read the part from the 1132312 byte to the 2132312 byte into memory. And than in memory having the option to do normal things like it was a normal file like reading it from the begin to then end byte by byte. Also is it possible to say something like replace the part from the 12312312 byte to the 22312312 byte with this that I have in memory?
I only know of things like read write and append but as far as I know this is only possible with small files.
Thanks in advance,
David
Offline
I only know of things like read write and append but as far as I know this is only possible with small files.
In C and most lower level languages, opening a file requires something in the area of 2-3 pointers. That's it. The file handle and what's called a "file pointer" which contains the location. You can use open(), seek(), and read() to get where you want are read the amount you want.
Offline
What language are you using?
Offline
Many languages have a file pointer. You can move the pointer to anywhere in the file and read your required amount of data from that point onwards. The command to move the pointer is often MOVE or SEEK... check out your lanuage docs.
Microsoft stole my computer, Linux gave it back.
Offline
Hello,
Thanks for your replys, and sorry for my very late reply, I forgot to it
I use ruby, I have found what you mean, it is IO.pos= to move to a position in the file. I haven't tested with a file bigger than the mem+swap but I think it works.
Thanks,
David
Offline
Pages: 1