Wire Sysio Wire Sysion 1.0.0
|
#include <filesystem.hpp>
Public Member Functions | |
simple_lock_file (const path &lock_file_path) | |
~simple_lock_file () | |
bool | try_lock () |
void | unlock () |
simple class which only allows one process to open any given file. approximate usage: int main() { fc::simple_file_lock instance_lock("~/.my_app/.lock"); if (!instance_lock.try_lock()) { elog("my_app is already running"); return 1; } // do stuff here, file will be unlocked when instance_lock goes out of scope }
Definition at line 250 of file filesystem.hpp.
fc::simple_lock_file::simple_lock_file | ( | const path & | lock_file_path | ) |
fc::simple_lock_file::~simple_lock_file | ( | ) |
bool fc::simple_lock_file::try_lock | ( | ) |
void fc::simple_lock_file::unlock | ( | ) |