简体   繁体   中英

Read/Write in Memory Mapped files in C++ using Boost

I'm a newbie to the world of Boost and was trying to Read/Write in memory mapped binary files. But I don't really know what to do actually and stuck somewhere in between. To be precise, I want my binary file to be memory mapped and then perform read/write operations on it. Till now, I've been trying to do stuff like :

stream_buffer<file_sink> is("test.txt");
std::ostream out(&is);
out << "This is written to file." << std::endl;
is.close();

Please help me understand how to proceed for this kind of problem. A POC would be great to understand. Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM