J
John Gordon
In said:I want to take a 700MB file and skip evey 200MB, so I thought of this.
You mean you want to copy the 700MB file to another file, omitting
200MB chunks?
long * space=malloc(sizeof(long)*500000);
There's no need to allocate that much space for a simple copy operation.
You can copy, say, 8K or 16K at a time without allocating a huge buffer.
That would be good for code wouldn't it? Now how to tell where I am in the
file. I have two choices. ftell() and fseek() or use f*pos() functions.
Would anyone have any suggestions?
The f*pos() functions handle files which are too large for ftell/fseek,
and they also have special code to handle multibyte stream content.
If you don't care about those two concerns, then either functions will
work.
(By the way, I got this information by doing a Google search on the
phrase "what is the difference between ftell and fgetpos?")