martinos/boson — comment on commit ad9c73ec0b722d644afd6f65d8194a1f42907246
File:  line 0
By martinos:

Sorry seems that I did not sent you the comments that I have put in my source. The reason why I have not used "w", is that the file is truncated when you open it. So truncation cannot be protected by a lock.

When you use r+ the file is not truncated at opening. It's the only way that I found that you can protect the truncation with a lock.

On 2011-12-11, at 23:21:49, Gabriel Horner wrote:

> What's the advantage of using r+ over w if you're manually truncating?
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/martinos/boson/commit/ad9c73ec0b722d644afd6f65d8194a1f42907246#commitcomment-785908