------------------
- mallen22@concentric.net
- http://members.tripod.com/mxf_entertainment/
Opening files
I just use good old DOS fopen.
I'm just wondering how most of you open files, I know how I just want to see what the fastest and most common way is.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement