Subject: Re: [boost] [AFIO] Formal review
From: Jeremy Maitin-Shepard (jeremy_at_[hidden])
Date: 2015-09-02 18:44:38
On Wed, Sep 2, 2015 at 11:50 AM, Niall Douglas <s_sourceforge_at_[hidden]>
> On 1 Sep 2015 at 23:51, Jeremy Maitin-Shepard wrote:
> > The normal way to do this with POSIX *at APIs would be to just open a
> > handle to the directory in the first place. I suppose the purpose of
> > more complex approach is to avoid having to keep an extra file descriptor
> > to the directory open, or to allow the user to open a sibling file from
> > arbitrary AFIO file handle without preparing in advance (as I suppose
> > be required by your shadow file-based locking approach). It does seem
> > rather specific and not necessarily all that common functionality to
> > require users to pay for by default.
> The approach you just suggested doesn't handle the case where you
> open a file, and then it gets moved before the sibling lookup.
> Fair enough; I think the desired semantics would depend on the particular
case. It seems there is always a time at which you issue the open call in
order to open/create the sibling file, and there will inevitably be a race
between that and concurrently moving the original file.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk