Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
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?
Posted

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 use CreateFile to do that. You may run into access restrictions on Vista/Windows 7 though.
 
Share this answer
 
v3
Comments
Joseph Marzbani 31-Oct-11 15:08pm    
yes I do. but that is a windows approach while I intend a "portable C++ approach".
Nish Nishant 31-Oct-11 15:11pm    
There is no portable approach to these things, since C++ is agnostic of the file system (mostly).
Espen Harlinn 31-Oct-11 15:30pm    
5'ed, true as far as the os and standard c/c++ libraries are concerned
Nish Nishant 31-Oct-11 15:31pm    
Thanks.
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
 
Share this answer
 
v2
Comments
Nish Nishant 31-Oct-11 15:32pm    
Interesting link - had not heard of that before. Voted 5!
Espen Harlinn 31-Oct-11 16:18pm    
Thank you, Nish - I've written a real-time data historian on top of ACE, and I've always been very happy with both the library and the community.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900