accessing larger than 2mb files.

how can i acces files beyond the long size?
I need to create my own data base program and need to get beyond the size limit of the long.
Your question suggests that you're doing something very wrong. How are you reading these files?
i'm opening the files and using ftell to get the pos and file size by using
fseek().

I use a unsigned long to store the result and not really error checking, do you think i can read 4mb files this way? but even then I need to get past 4mb.

using fseek() i don't think i can read beyond 2mb when passing a long.
Last edited on
It seems i'll have to seek in blocks, and do searching :(
¿ sizeof(long) ?
You need to use one of the OS functions to do it.

For Windows, use CreateFile().
For *nix, see http://learn-from-the-guru.blogspot.com/2008/02/large-file-support-in-linux-for-cc.html

You really should try to avoid having such huge file though.
Topic archived. No new replies allowed.