Boost logo

Boost Users :

From: Elisha Berns (e.berns_at_[hidden])
Date: 2005-08-26 02:17:51

Hi again,

Odd, today I have only had PROBLEMS with boost. I guess it's just one
of those days. Anyways, the open_impl() method for
iostreams::mapped_file_source just doesn't open any mappings for files.
I realize that it is reused by the mapped_file class, but that is what
seems to cloud the design, flow and working of it as it needs to please
everyone here, and it doesn't. It always throws in this location:

    pimpl_->mapped_handle_ =
        ::CreateFileMappingA( pimpl_->handle_, NULL,
                              readonly ? PAGE_READONLY : PAGE_READWRITE,
                              0, 0, p.path.c_str() );
    if (pimpl_->mapped_handle_ == NULL) {
        detail::cleanup_and_throw(*pimpl_, "couldn't create mapping");

However, if I use just the raw Win32 APIs all works fine:

        HANDLE hFile = CreateFile(szFile,

        if ( hFile == INVALID_HANDLE_VALUE )
        HANDLE hFileMapping = CreateFileMapping(hFile, NULL,
        if ( hFileMapping == 0 )
        void* pView = ::MapViewOfFile(hFileMapping, FILE_MAP_READ, 0, 0,
        if ( pView == 0 )

Anyways, here my desire is to use the boost libraries as an insulation
layer to enable writing cross-platform C++, but obviously if it doesn't
work that idea doesn't go too far. So I really hope this gets

Many thanks,

Elisha Berns
tel. (310) 556 - 8332
fax (310) 556 - 2839

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at