There are several approaches that depend on the specifics of your task.
If you need to work with the file system (that is, through the functions and classes of the file system APIs), and you want to quickly, then (as I suggested in response to your previous question) you need to create a RAMDisk driver. The Windows driver package includes an example driver that (coincidence?) Is named "RamDisk". Driver development, however, is complicated, and if something goes wrong with the sample or you need to expand it, you will need to delve deeper into kernel mode development (or hire someone to do the job). Why kernel mode? The reason, as you could see with Dokan, switching to user mode for storing data leads to a serious slowdown.
If you just need to conveniently manage a bunch of files in memory using the Stream class (with the possibility of flushing it to disk), you can use one of the virtual file systems. Our SolFS (Application Edition) is one of those products that you can use (I can also recall the CodeBase file system, but they don't seem to provide an evaluation version). SolFS seems to fit your task, so if you think so, you can contact me privately (see My profile) for help.
To answer your questions:
No, memory mapped files (MMFs) are literally files on disk (including a virtual disk, if any) that can be accessed not through the file system API, but directly using memory operations. MMF is generally faster for most file operations, so it is often mentioned.
Our reverse file systems or CallbackDisk products (see virtual memory ) are an alternative, however, as I mentioned in the first, they will not be able to solve your problem due to switching the user mode context.
Update: I see no obstacle for the driver to have a copy in memory and write to the disk asynchronously when necessary. But for this you will need to modify the RAMDisk driver example (and this is due to a rather large amount of programming in kernel mode).
Using SolFS or another virtual file system, you can also have a copy of the storage on disk. In the case of a virtual file system, it might seem that working with the container file on disk will give you satisfactory results (since the virtual file system usually has a memory cache), and you wonβt need to save a copy in memory at all.
source share