I was in the middle of creating a test program, and when I was writing the win32 API version, I decided to look more into the CreateFile function. For the dwFlagsAndAttributes parameter, you can use:

FILE_FLAG_RANDOM_ACCESS
Indicates that the file is accessed randomly. The system can use this as a hint to optimize file caching.

FILE_FLAG_SEQUENTIAL_SCAN
Indicates that the file is to be accessed sequentially from beginning to end. The system can use this as a hint to optimize file caching. If an application moves the file pointer for random access, optimum caching may not occur; however, correct operation is still guaranteed.
Specifying this flag can increase performance for applications that read large files using sequential access. Performance gains can be even more noticeable for applications that read large files mostly sequentially, but occasionally skip over small ranges of bytes.


It looks like the two methods that I was going to use for my test program to emulate real-world behaviour each have specific settings within CreateFile to optimize the caching... I did not finish my program, I had to leave my office right as I found out this information. I just thought I would write now, and let you know. If you use the Win32 API for the specific purpose of random or sequential access, then these settings should be specified as part of the program. I will try them out tomorrow, and see.