Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Slayer-X

Opening files

This topic is 6817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
If you're using Windows and you want speed the Win32 API functions CreateFile, ReadFile, WriteFile should be fastest. All the other options (fopen/istream/whatever) call on the services of these functions at some point. The only thing to watch is that they aren't buffered. So if you make lots of short reads or writes it will go SLOOOOOWWWWWW!

If I want speed and buffering, I use CreateFileMapping and MapViewOfFile. These allocate a file into the process's address space so you can access it through a pointer. Its kind if like turning the file into a second swapfile.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!