使用纯C ++进行文件映射 [英] file mapping using pure c++
本文介绍了使用纯C ++进行文件映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以实现一种类似于"Windows文件映射"的机制,在其中可以将磁盘上的大文件当作未加载的文件来对待吗?
can I implement a mechanism like "windows file mapping" in which you can treat large files on disk as if they''re already loaded while they''re not?
推荐答案
您是指内存映射文件吗?如果是这样,请参见 http://msdn.microsoft.com/en-us/library/dd997372.aspx [ ^ ]
如果您是直接访问磁盘,则可以使用CreateFile
来完成.不过,您可能会在Vista/Windows 7上遇到访问限制.
Do you mean memory mapped files? If so, see http://msdn.microsoft.com/en-us/library/dd997372.aspx[^]
If you mean direct disk access, you can useCreateFile
to do that. You may run into access restrictions on Vista/Windows 7 though.
看看^ ]:
http://www.dre.vanderbilt.edu/Doxygen/5.5/html/ace/classACE__Mem__Map.html [ ^ ]
ACE是高效的,并且经过了严格的测试:)
它也可用于大多数相关的操作系统和编译器...
最好的问候
Espen Harlinn
Have a look at the ACE C++ library[^]:
http://www.dre.vanderbilt.edu/Doxygen/5.5/html/ace/classACE__Mem__Map.html[^]
ACE is efficient and exceptionally well tested :)
It''s also available for most relevant operating systems and compilers ...
Best regards
Espen Harlinn
这篇关于使用纯C ++进行文件映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文