Hi,

I have a file of approximately 4.19GB. I want to get the totall size of file using code in VC++, Here is my code

FILE *fptrSampleVideo = fopen(filename,"rb+");

if(fptrSampleVideo)
{

fseek(fptrSampleVideo,0,SEEK_END);

uncompressedVideoSize = ftell(fptrSampleVideo);

}

If the file is of small size, ftell() return position correctly and the size is also correct.

If the file is of large size (4.19GB), ftell() return position 4, which is wrong.

It must return 4,190,000,000 etc. some thing like that.

can any one guide me what is the case?

Many Thanks,

--
Regards,
Asif

ftell() returns a long int, and the max value is declared in limits.h. If yours is like mine then the 4 gigs is too big.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.