Boost logo

Boost :

From: (noreply_at_[hidden])
Date: 2006-03-08 04:03:52

Support Requests item #1445474, was opened at 2006-03-08 01:03
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: boost.iostreams file_descriptor and sharing

Initial Comment:

I have couple of questions about the behavior of

First, I've noticed that it always opens files with
exclusive access. That is, it calls CreateFileA with a
dwShareMode of 0, which means that "the object cannot
be shared and cannot be opened again until the handle
is closed". Is this by design? Wouldn't it be
reasonable to use a share mode of FILE_SHARE_READ when
opening a file only for reading?

Second, the function file_descriptor::open has a third
parameter 'base', which appears to be extra open mode
bits that are always on, in addition to those in the
second parameter to stream::open. What is the purpose
of this? Since there is a stream::open function with
three parameters I can specify these extra bits as well
when opening the file, in order to actually get the
file opened only for reading, but I worry that this
will somehow violate the design of the file_descriptor

I've modified my copy of file_descriptor::open to use a
share mode of FILE_SHARE_READ when opening a file only
for reading and am now calling stream::open with three
arguments in order to make this happen. Is this safe?
It appears to work in the very limited cases I've tried
so far.

Gunnar Blomberg (Gunnar.Blomberg_at_[hidden])

PS. Thanks for an excellent library!


You can respond by visiting:

This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
Boost-bugs mailing list

Boost list run by bdawes at, gregod at, cpdaniel at, john at