Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] [file_mapping] is there any way to avoid writing a modified file to disc?
From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2011-12-07 08:29:20


On Thu, Dec 8, 2011 at 12:19 AM, Thorsten Ottosen
<thorsten.ottosen_at_[hidden]> wrote:
> Hi,
>
> I'm using file_mapping/mapped_region with Boost 1.45. My idea was to load
> the memory mapped file in read/write mode and then decrypt the
> file content in-place (to avoid copying the entire file content). However,
> this will save a decrypted file :-(
>
> Is there any way to avoid the file being saved after in-memory manipulation?
>

In POSIX there's a way to say that a read/write region can be declared
private -- changes to it would not be propagated to the underlying
file. I don't see a way from the docs of providing the MAP_PRIVATE
flag to the call to mmap.

Not sure if there's a similar concept in Windows.

Cheers

-- 
Dean Michael Berris
http://goo.gl/CKCJX

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net