Class: File
- Inherits:
-
Object
- Object
- File
- Defined in:
- lib/fsdb/file-lock.rb
Overview
Extensions to the File class for non-blocking file locking, and for recording a Format in the File object.
Constant Summary collapse
- CAN_DELETE_OPEN_FILE =
!FSDB::PLATFORM_IS_WINDOWS
- CAN_OPEN_DIR =
!FSDB::PLATFORM_IS_WINDOWS
Instance Attribute Summary collapse
-
#format ⇒ Object
Returns the value of attribute format.
Instance Method Summary collapse
-
#lock_exclusive_fsdb(lock_type) ⇒ Object
Get an exclusive (i.e., write) lock on the file.
-
#lock_shared_fsdb(lock_type) ⇒ Object
Get a shared (i.e., read) lock on the file.
Instance Attribute Details
#format ⇒ Object
Returns the value of attribute format.
5 6 7 |
# File 'lib/fsdb/file-lock.rb', line 5 def format @format end |
Instance Method Details
#lock_exclusive_fsdb(lock_type) ⇒ Object
Get an exclusive (i.e., write) lock on the file. If the lock is not available, wait for it without blocking other ruby threads.
13 14 |
# File 'lib/fsdb/file-lock.rb', line 13 def lock_exclusive_fsdb lock_type # :nodoc end |
#lock_shared_fsdb(lock_type) ⇒ Object
Get a shared (i.e., read) lock on the file. If the lock is not available, wait for it without blocking other ruby threads.
16 17 |
# File 'lib/fsdb/file-lock.rb', line 16 def lock_shared_fsdb lock_type # :nodoc end |