File pointer

Just starting out? Need help? Post your questions and find answers here.
Nubcake
Enthusiast
Enthusiast
Posts: 195
Joined: Thu Feb 03, 2011 7:44 pm

File pointer

Post by Nubcake »

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 :D

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