I was advised by a friend of mine to use fread64, fwrite64 instead of fread and fwrite. Does this exist? Been looking for it's documentation but I haven't found one.
jaepi 22 Practically a Master Poster
Recommended Answers
Jump to PostNo. I think it is a Solaris-specific extension.
Do you think you will need to read or write files larger than 2GB?
Jump to PostNone of this stuff is standard. You'll need to check your compiler's documentation. In some cases fread and fwrite work just fine once you've opened a file with fopen64. In other cases you'll need to use some special functions and/or variables. Sometimes the fseek and ftell functions are modified instead.
…
Jump to Post> I should define _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE to the .cpp files where I use fread and fwrite?
yes, if you want to use files of sizes beyond the usual limit of 2GB on 32 bit systems. see the documentation for these macros
All 12 Replies
Duoas 1,025 Postaholic Featured Poster
jaepi 22 Practically a Master Poster
Duoas 1,025 Postaholic Featured Poster
jaepi 22 Practically a Master Poster
Duoas 1,025 Postaholic Featured Poster
jaepi 22 Practically a Master Poster
Duoas 1,025 Postaholic Featured Poster
jaepi 22 Practically a Master Poster
jaepi 22 Practically a Master Poster
Duoas 1,025 Postaholic Featured Poster
vijayan121 1,152 Posting Virtuoso
jaepi 22 Practically a Master Poster
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.