
On Tue, Jul 1, 2008 at 10:40, David Abrahams <dave@boostpro.com> wrote:
Beman Dawes wrote:
The remove(p) function is currently specified to return a bool with a value of exist(p) before the post-condition is established. The post-condition is !exists(p).
You can't really guarantee that, can you? Can't some other process sneak in and re-create p before remove returns?
There's a blanket "Effects and Postconditions not guaranteed in the presence of race-conditions" in effect for the whole library: http://www.boost.org/doc/libs/1_35_0/libs/filesystem/doc/index.htm#Cautions
[...]
Thus I'd like to change the return to void. Although that will break some code, the breakage will result in a noisy compile-time error that is easy to fix by inserting a call to exits() before the call to remove().
Comments?
Sounds like you're making the right choice here.
Sounds good to me too. If there's a potential race there anyways, might as well let the user write it explicitly. ~ Scott