Boost logo

Boost :

From: Stewart, Robert (stewart_at_[hidden])
Date: 2002-03-28 08:41:33


From: Ross Smith [mailto:r-smith_at_[hidden]]
>
> Dylan Nicholson wrote:
> >
> > --- Ross Smith <r-smith_at_[hidden]> wrote: > Dylan Nicholson wrote:
> > > >
> > > > >
> > > > access(filename, W_OK) == W_OK?
> > >
> > But it is the only recognised way under POSIX of
> determining whether a file is
> > writable.
>
> But it _doesn't_ determine that.
>
> The essential point I'm trying to make is that a test that can't be
> trusted is useless. Unless we can have an is_readonly() test that's
> _guaranteed_ to always give the right answer, there's no
> point in having
> it at all.
>
> 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.)

Rob
Susquehanna International Group, LLP
http://www.sig.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk