I am initialising the boost mapped_file_params as shown below.
mapped_file_params param;
param.path = _fileName.c_str();
param.flags = mapped_file::readwrite;
int nGranularity = mapped_file::alignment();
//! must be in multiples of Granularity.
param.offset = 5*nGranularity;
When I open the file with a filesize, I get an std::exception reading "at most one of 'mode and 'flags may be specified". I have not populated the mode as from the documentation of boost, it says that mode is deprecated. further new code should use flags is what is suggested.
My boost file type is defined as
boost::iostreams::mapped_file _bioFile;
I have attempted to open the file using
_bioFile.open(param, filesize);
boost IO documentation : http://www.boost.org/doc/libs/1_57_0/libs/iostreams/doc/classes/mapped_file.html
Am I missing something.
对于那些想要答案的人,我可以使用此代码解决问题。
_bioFile.open(_fileName.c_str(), std::ios_base::in | std::ios_base::out, filesize);
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.