diff options
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h index dc426830b..a57a85fee 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -91,6 +91,20 @@ namespace tools const std::string& filename() const noexcept { return m_filename; } }; + class file_locker + { + public: + file_locker(const std::string &filename); + ~file_locker(); + bool locked() const; + private: +#ifdef WIN32 + HANDLE m_fd; +#else + int m_fd; +#endif + }; + /*! \brief Returns the default data directory. * * \details Windows < Vista: C:\\Documents and Settings\\Username\\Application Data\\CRYPTONOTE_NAME |