Click here to Skip to main content
Rate this: bad
good
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 at 31-Oct-11 15:08pm
   
yes I do. but that is a windows approach while I intend a "portable C++ approach".
Nishant Sivakumar at 31-Oct-11 15:11pm
   
There is no portable approach to these things, since C++ is agnostic of the file system (mostly).
Espen Harlinn at 31-Oct-11 15:30pm
   
5'ed, true as far as the os and standard c/c++ libraries are concerned
Nishant Sivakumar at 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 at 31-Oct-11 15:32pm
   
Interesting link - had not heard of that before. Voted 5!
Espen Harlinn at 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
0 DamithSL 270
1 OriginalGriff 184
2 BillWoodruff 170
3 Zoltán Zörgő 165
4 Sergey Alexandrovich Kryukov 125
0 OriginalGriff 7,760
1 DamithSL 5,874
2 Sergey Alexandrovich Kryukov 5,444
3 Maciej Los 5,076
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 31 Oct 2011
Copyright © CodeProject, 1999-2014
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