Opened 11 years ago

Closed 11 years ago

#5694 closed Feature Requests (worksforme)

Cannot use managed_mapped_file to handle a txt file

Reported by: chmodexplorer@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

On Windows or Linux, we can map a txt file into the current process' address space, and then use those string handling functions with the return value (the pointer to the first byte of the content of the txt file) to deal with the file. So I wrote such an expression: boost::interprocess::managed_mapped_file mmf(

boost::interprocess::open_only, txt_file_name

); But it throwed an exception when the line 424 in the file managed_open_or_create_impl.hpp was executed:

if(value != InitializedSegment)

throw interprocess_exception(error_info(corrupted_error));

Change History (1)

comment:1 by Ion Gaztañaga, 11 years ago

Resolution: worksforme
Status: newclosed

You are using the wrong class. Managed_mapped_file is for files created with this class. To simply map a txt use file_mapping + mapped_region.

Note: See TracTickets for help on using tickets.