I wrote a small library that provides atomic files with transaction support on platforms that don't have native transactional filesystems. I basically wrote that to avoid potential file corruption when writing out things like save game files etc., but it should be widely useful especially since the transactions can be nested.
The library can be found at bitbucket: https://bitbucket.org/sherief/ext-atomic-file .It's BSD licensed and has only one dependency (SQLite 3). The repository contains Visual Studio 2012 and Xcode 4.x projects. The code is in C (though it's compiled as C++ on VS since it uses some C99 features) and should be portable.
Questions and comments welcome.