Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2005-05-04 09:20:29


From: Thomas Witt <witt_at_[hidden]>
> Beman Dawes wrote:
> > "Thomas Witt" <witt_at_[hidden]> wrote in message
> > news:d58cm5$mso$1_at_sea.gmane.org...
> >
> >>Hmm, what's the benefit of having symlink_status() and status() ? Wouldn't
> >>one function suffice that sets the symlink flag when a symlink is
> >>encoutered on the way. I.e.
> >
> > I considered that briefly, but rejected it because status() on POSIX would
> > then require two calls; one to stat() and one to lstat().
>
> Hmmm .. mildly convincing.

I don't find it convincing. Should such an implementation detail
drive what may well become a standardized interface? Besides,
when an implementor provides this information, s/he probably has
(or can create) useful low level, nonportable APIs available to
make this efficient.

> > There is also a nice simplicity in the current design; the functions always
> > returns a value with one and only one flag set.
>
> In this case the fact that it is a bitmask type seems to be kind of
> misleading. Isn't the whole point of a bitmask type to be able to have
> multiple flags set at once?

I agree. What's the point of the bitmask? As described, masking
is needed, but since only one value is ever actually returned,
what's the point? Equality comparisons are easier than bitmasks.

> > Neither of those are really killer arguments, so if others think it would be
> > better to have a single status() function, I'd like to hear their arguments.
>
> I am up in the air about it. On the one hand it seems wrong to me to
> have a suboptimal interface only because posix has one, on the other
> hand performance might be an issue.

I don't think performance needs to be a factor.

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

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