summaryrefslogtreecommitdiff
path: root/src/stable/file.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/stable/file.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/stable/file.h b/src/stable/file.h
index e3497d3..6e05dc7 100644
--- a/src/stable/file.h
+++ b/src/stable/file.h
@@ -56,6 +56,25 @@ namespace Bu
56 virtual bool isBlocking(); 56 virtual bool isBlocking();
57 virtual void setBlocking( bool bBlocking=true ); 57 virtual void setBlocking( bool bBlocking=true );
58 58
59 /**
60 * Tells you if advisory locks are supported.
61 */
62 bool canLock() const;
63
64 /**
65 * Acquires an advisory lock on the file. On posix/linux this is done
66 * via flock.
67 *@param bExclusive Set to true to acquire an exclusive lock (i.e. a
68 * write lock). If this is false then a shared lock (i.e. read lock) is
69 * acquired. A file cannot have both an exclusive and shared lock.
70 */
71 void lock( bool bExclusive=true );
72
73 /**
74 * Release the held advisory lock.
75 */
76 void unlock();
77
59 enum { 78 enum {
60 // Flags 79 // Flags
61 Read = 0x01, ///< Open file for reading 80 Read = 0x01, ///< Open file for reading