[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Opening and Reading Files over 4GB

Posted on 1999-11-09
2
Medium Priority
?
296 Views
Last Modified: 2008-01-16
A little background:
I have noticed that the seekg() and seekp() funtions in the Standard C++ library takes an unsigned long and a parameter (maybe a long) but when dealing with really large files like this you cannot use these functions.

Two Part Question:

Does anyone know if there are any FREE libraries out there that allow a read of this size?

Is there a way to modify VC++ 6.0 library files to acomplish this?  If so, where would you start?  Would you use inheritance on something like streambuf or start at a more derived level than that?
0
Comment
Question by:snifong
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
ID: 2195180
If you want to handle such a large file, you have to use Win32 File functions, such as CreateFile, ReadFile, SetFilePointer.

SetFilePointer is able to do it.
0
 
LVL 2

Expert Comment

by:Gandalf32
ID: 2197779
You can do this using memory mapped files, and map different segments of the file into memory. These functions are very efficient, as they only load the parts you access.
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

640 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question