+void
+Data::write (boost::filesystem::path file) const
+{
+ FILE* f = fopen_boost (file, "wb");
+ if (!f) {
+ throw FileError ("could not write to file", file, errno);
+ }
+ size_t const r = fwrite (_data.get(), 1, _size, f);
+ if (r != size_t (_size)) {
+ fclose (f);
+ throw FileError ("could not write to file", file, errno);