I am given a binary file (consider it large) and a several binary blobs, which I should insert/replace somewhere in the middle of the file (offsets are known).
The same time user may gain access to the file, thus I must have "all of nothing", either user have an old version of the file if she opens it before I have updated everything, or she has a new version if I succeeded.
I am interesting in solutions for Linux, Windows and OS X. Of course, implementation may be different.