Boost logo

Boost :

From: Dylan Nicholson (dylan_nicholson_at_[hidden])
Date: 2002-03-27 15:19:56


 --- Ross Smith <r-smith_at_[hidden]> wrote: > Dylan Nicholson wrote:
> >
> > >
> > access(filename, W_OK) == W_OK?
>
> That gives you the access rights for your real user/group id, not your
> effective user/group id -- i.e. it tells you whether the user running
> the process can write to the file, not whether the calling process can.
>
But it is the only recognised way under POSIX of determining whether a file is
writable. It is certainly what is used by a large body of existing software.
If POSIX defines it to work as you say then there is surely some reason for
this (I'd be intrigued to know why). I would guess that processes that
typically run with a different effective-uid have to be careful in general
about checking permissions etc. As it is probably most of them run with
effective-id = root so it's often not an issue anyway.

Dylan

http://www.sold.com.au - SOLD.com.au Auctions
- 1,000s of Bargains!


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