Boost logo

Boost :

Subject: Re: [boost] [filesystem]Setting permissions/chmod
From: Johan Torp (johan.torp_at_[hidden])
Date: 2008-10-13 14:15:06

Beman Dawes wrote:
> I've tried a couple of times to research implementing POSIX style
> permissions on Windows, but quickly got lost in the complexities of the
> Win32 permissions and ownership scheme. I know it can be done for
> permissions, because Cygwin does it.
> Just last week I had an email exchange with Bjarne Stroustrup on the
> topic.
> He asked us to explore the possibility of providing a non-portable
> approach
> if a portable approach wasn't possible.
> He asked about providing a function (or functions) that could be adapted
> to
> various operating systems. Perhaps something like:
> void set_permissions( const path & p, const permissions & perms );
> void set_ownership( const path & p, const ownership & owners );
> Where permissions and ownership are implementation-defined.
> * On POSIX, permission would mimic the chmod arguments, ownership would
> mimic chown arguments.
> * On Windows, permission and ownership would be something appropriate for
> Windows.
> (The above is just thinking out loud, not a serious proposal.)
> I'm not opposed to providing system specific features for
> Boost.Filesystem,
> but would like to explore the alternatives first. A starting point might
> be
> to try to independently define permissions and ownership for POSIX and
> Windows, and then try to see if there is any commonality. I'd need some
> help
> from folks who understand the Windows permissions and ownership model.
> Thoughts?

I think there would be a lot of value in having the functionality in boost.
I can't even guess what the interfaces would look like since it's such a
complex domain and I lack good understanding of windows security model.

Starting out with two separate implementations might work. Something like
boost::filesystem::win32 and boost::filesystem::posix which can later on be
deprecated if common abstractions are found.

It would be good to have some "live" library fast, maybe it can be setup as
an external library which aims for a later inclusion in boost once it's
matured. In general, I think it would be very beneficial for many libraries
if there was some kind of packaged preliminary step before acceptance into
boost. Libraries in the preliminary stage would have more lax requirements
and moving interfaces but should still be fairly well tested. Perhaps they
could be packaged and released individually and that work burden could be
placed on the authors - boost would just provide some framework for doing so
and link to the preliminaries from the download and doc pages of Finding things in the sandbox and vault is a big threshold
for most users.


View this message in context:
Sent from the Boost - Dev mailing list archive at

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