Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2004-11-27 16:04:53


At 01:42 AM 11/27/2004, Keith Burton wrote:

>Does using last_write_time leave an opportunity for false negative
>because it has been updated in between obtaining the value for each
>filename?

Holding open the first fir handle until the second has also been processed
protects against race conditions caused by defragging. But not against a
file size or last write time change.

I'm not sure there is anything that can be done about that. Race conditions
can often poison filesystem operations; that's just a fact-of-life with
most operating systems.

> Would using creation_time ( if available ) be safer ?

My feeling was that if a filesystem only supported a single date (as some
legacy systems did), then it was likely to be last_write_time.

While there are theoretical holes in the current logic, I'm hoping that it
provides a practical implementation useful in real-world applications. If
users run into practical problems, I hope they will report them here right
away.

--Beman


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