Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   i wnat to wonder around a file of 10^29 character ....... in any way... (http://www.go4expert.com/forums/i-wnat-wonder-file-1029-character-t23091/)

savalia jay 24Aug2010 14:58

i wnat to wonder around a file of 10^29 character ....... in any way...
 
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 24Aug2010 15:00

Re: i wnat to wonder around a file of 10^29 character ....... in any way...
 
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 25Aug2010 12:44

Re: i wnat to wonder around a file of 10^29 character ....... in any way...
 
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 25Aug2010 18:08

Re: i wnat to wonder around a file of 10^29 character ....... in any way...
 
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 25Aug2010 22:08

Re: i wnat to wonder around a file of 10^29 character ....... in any way...
 
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).


All times are GMT +5.5. The time now is 09:03.