i wnat to wonder around a file of 10^29 character ....... in any way...

savalia jay's Avatar, Join Date: Aug 2010
Newbie Member
i know one function that is fseek but its second argument is long so we cant use.....bcz file has 10^28 character and is outside the range of long.........

can any one help...me...
savalia jay's Avatar, Join Date: Aug 2010
Newbie Member
i know one function that is fseek but its second argument is long so we cant use.....bcz file has 10^29 character and is outside the range of long.........

can any one help...me...
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
You'll have to look in your platform-specific documentation. As you have discovered, the C standard library doesn't cover such large numbers. There might be a large file platform-specific (i.e. non-standard) extension to the FILE stuff, or it could be reimplemented in a different library.

Another approach could be to use redirection, e.g.:
cat bigfile | myprog

then in myprog just do
Code:
while ((c=getchar())!=EOF)
{
 // ...
}
although that is one-way wandering, not random access.
savalia jay's Avatar, Join Date: Aug 2010
Newbie Member
but i want to move around file....
means currently pointer is at 10^27 now i want to read a character which at 10^19 how can i do............?
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
Yes, that's why I said "You'll have to look in your platform-specific documentation".

I can't do that because you've given no clues as to what your platform is, other than that it's an OS with a filesystem that caters for single file sizes up to at least 100,000 Yottabytes (Yotta=1,000,000 Exa; Exa=1,000,000 Tera; Tera=1,000,000 Mega).