Hello again,
If ftell() return long type, is that mean that the maximum file size possible is LONG_MAX ??
Printable View
Hello again,
If ftell() return long type, is that mean that the maximum file size possible is LONG_MAX ??
Pretty much. Anything larger and you will have to resort to other APIs. I don't think the C standard has any other function for getting filesize, and especially not bigger than long.
Note here: just because ftell() can't return the correct size of the file does not mean this is the largest possible file-size. Native APIs may have different ways to give the value (e.g. a 64-bit integer even if "long" is 32-bit).
Linux/Posix allows for a "fgetpos()" that has a larger value, for example.
So, what I'm trying to say is "ftell() doesn't work on files longer than LONG_MAX", but it doesn't actually say ANYTHING about the largest possible file in that filesystem, OS or C runtime library.
--
Mats
Yep.
I've created a 3000,000 kb.
ftell() gave the right result until MAX_LONG after that it return -1.
I actully created 9.5 GB file.
Anyone know what is the limit in windows XP?
Many thanks