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

Newbie Member
24Aug2010,14:58   #1
savalia jay's Avatar
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...
Newbie Member
24Aug2010,15:00   #2
savalia jay's Avatar
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...
Mentor
25Aug2010,12:44   #3
xpi0t0s's Avatar
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.
Newbie Member
25Aug2010,18:08   #4
savalia jay's Avatar
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............?
Mentor
25Aug2010,22:08   #5
xpi0t0s's Avatar
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).