mirror of
https://github.com/monero-project/monero.git
synced 2025-08-09 00:32:22 -04:00
util: add file_locker class
This commit is contained in:
parent
1d176473e9
commit
59de6f8d99
2 changed files with 81 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue