File pointer
Posted: Sat Dec 21, 2013 7:17 pm
Hi
I'm creating a program for personal use to split and merge files > 2GB in size and I was wondering about a few things I hope the PB community can help me with
Is there a way I can get a pointer to the file I want to split without having to allocate a huge chunk of memory for it? Say I had a 2GB file I wanted to split into 4 500MB files, can I get a pointer to the 2GB file and just allocate 500MB without having to load the whole 2GB into memory then get a pointer to it.
How would I go about speeding up this operation of reading and writing to disk very fast? Would I read/write 1 byte at a time or is at too slow?
Thanks
Nubcake
I'm creating a program for personal use to split and merge files > 2GB in size and I was wondering about a few things I hope the PB community can help me with

Is there a way I can get a pointer to the file I want to split without having to allocate a huge chunk of memory for it? Say I had a 2GB file I wanted to split into 4 500MB files, can I get a pointer to the 2GB file and just allocate 500MB without having to load the whole 2GB into memory then get a pointer to it.
How would I go about speeding up this operation of reading and writing to disk very fast? Would I read/write 1 byte at a time or is at too slow?
Thanks
Nubcake