Gopi Krishna Komanduri wrote:
>       Hi,
> 
>    I need to write a huge amount of data to a file (size can be more
> than 100 GB , some times even more than 1000GB) , upto my knowledge ,
> using FILE pointer , I can write to file , max of 4GB size as the size
> of FILE pointer is 32 bits.
> 
>  Can I use fstream to write a large amount of data?  Please suggest
> 
> BTW , though I am developing on windows , it should be platform independent 
> as I need to port the code to various OSs .
> 
> Thx,
> --Gopi
> 9705355488

The size of FILE * doesn't matter.  It is an abstract data structure. 
What is contained _within_ the data structure is what matters.  Most 
modern compilers these days _supposedly_ deal with large files just fine 
as long as you aren't trying to get or set the current file location. 
You should try creating a really large file to see if you can read and 
write just fine.

If not, check your compiler to see if fopen64() and friends are available.

Unfortunately, there isn't a single common API for such support for all 
OSes.  However, you only need to write two different bits of code:  One 
for *NIX systems (fopen64) and one for Windows (raw CreateFile() APIs). 
  If you use C++ classes, you can create an abstract interface so you 
only have to write file handling code one time.

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to