| 42 | { |
| 43 | public: |
| 44 | PersistentFile(const std::string& fn_arg) |
| 45 | : fn(fn_arg) |
| 46 | { |
| 47 | const int f = ::open(fn.c_str(), O_WRONLY|O_CREAT|O_CLOEXEC, S_IRUSR|S_IWUSR); |
| 48 | if (f < 0) |
| 49 | syserr("open"); |
| 50 | fd.reset(f); |
| 51 | } |
| 52 | |
| 53 | void write(const void *buf, size_t count) |
| 54 | { |