void copy(const char *src, const char *dst) { std::cout << "copying " << src << " to " << dst << std::endl; Mmap<char> mmap; CHECK_DIE(mmap.open(src)) << mmap.what(); std::ofstream ofs(dst, std::ios::binary|std::ios::out); CHECK_DIE(ofs) << "permission denied: " << dst; ofs.write(reinterpret_cast<char*>(mmap.begin()), mmap.size()); ofs.close(); }
int open(char const *name, int flags) { ++open_; return mm_->open(name, flags); }