Click here to Skip to main content
12,078,795 members (50,019 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C++
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 31-Oct-11 10:03am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
v3
Comments
Joseph Marzbany 31-Oct-11 15:08pm
   
yes I do. but that is a windows approach while I intend a "portable C++ approach".
Nishant Sivakumar 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
Nishant Sivakumar 31-Oct-11 15:31pm
   
Thanks.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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 Smile | :)

It's also available for most relevant operating systems and compilers ...


Best regards
Espen Harlinn
  Permalink  
v2
Comments
Nishant Sivakumar 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160212.1 | Last Updated 31 Oct 2011
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100