Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling Files greater than 2 GB in MSVC6!

Tags:

c

file

windows

Normal file related functions like fseek, ftell etc in Windows MSVC6 can handle files only upto 2GB (As per my current understanding, Please correct me if I am wrong).

I want to work with files >2GB. How should I go about it? What are the functions available?

like image 369
Jay Avatar asked Jan 21 '26 01:01

Jay


1 Answers

I am not sure but the limit is 4 GB, OS API and the standard libraries using theses API and the filesystem used.

The ftell, fseek functions are using 32 bit integers so you won't be able to handle file bigger than 4GB. You would have to use the OS API directly.

So you have to be careful what function you use, for example for getting the file size you have to use the ex function GetFileSizeEx, so you have to make sure you use function that use 64 bit file offset. Same for SetFilePointerEx

Last word you have be aware that some filesystem limit the maximum filesize, the FAT32 won't handle file bigger than 4 GB by design, NTFS would handle any size but the API generally is made for 4 GB or less big file.

like image 186
RageZ Avatar answered Jan 23 '26 15:01

RageZ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!