Boost logo

Boost :

From: Stewart, Robert (stewart_at_[hidden])
Date: 2002-04-01 10:54:28

From: Ross Smith [mailto:r-smith_at_[hidden]]
> "Stewart, Robert" wrote:
> >
> > From: Ross Smith [mailto:r-smith_at_[hidden]]
> > >
> > > If is_readonly() doesn't actually tell you whether the file is
> > > read-only, what possible use could it be?
> >
> > The purpose of this library is to enable scripting.
> Therefore, one must
> > ask, "What does a script do to test for write-ability?"
> Answer: "test -w
> > pathname" or its equivalent in the various shells. Who's
> got access to
> > implementations of test or shells that do it themselves?
> What does "test
> > -w" -- or whatever syntax your favorite shell uses -- do? (ksh, for
> > example, provides syntactic sugar for test, but ultimately
> calls test. I'm
> > guessing that there are shells that do the test themselves
> rather than
> > running test.)
> What on earth does any of that have to do with it?

I thought it was obvious. If "test -w" is good enough for Unix shell
scripting, then whatever it does should be good enough for a filesystem
scripting library implemented in C++. If that means that the "test -w" is
not foolproof or complete, then so be it.

If an application finds that it needs to get exactly the right answer in all
of the scenarios you've discussed -- and any you haven't thought to mention
-- then that application can provide its own platform-specific functionality
to determine writeability.

Susquehanna International Group, LLP

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