stldb::file_lock
// In header: </Users/bobw/workspace/stldb_lib/stldb/sync/file_lock.h> class file_lock : public ofstream { public: // construct/copy/destruct file_lock(const char *); file_lock(const char *, offset_t, size_t); ~file_lock(); // public member functions const char * filename() ; };
This is a file_lock which creates the file being locked, and destroys the file when the lock is released. Useful for cases where the file exists for no other purpose than to facilitate the lock
file_lock
public
construct/copy/destructfile_lock(const char * name);
Opens a file lock. Throws interprocess_exception if the file does not exist or there are no operating system resources.
Opens a file lock. Throws interprocess_exception if the file does not exist or there are no operating system resources.
file_lock(const char * name, offset_t offset, size_t size);
Opens a file lock. The lock is based on a portion of the file beginning at offset bytes from the start of the file, and extending from there for size bytes.
Opens a file lock. The lock is based on a portion of the file beginning at offset bytes from the start of the file, and extending from there for size bytes.
~file_lock();Closes a file lock. Does not throw.
Deletes the file.