Class File
In: lib/fsdb/file-lock.rb
Parent: Object

Extensions to the File class for non-blocking file locking, and for recording a Format in the File object.

Methods

Constants

CAN_DELETE_OPEN_FILE = !FSDB::PLATFORM_IS_WINDOWS
CAN_OPEN_DIR = !FSDB::PLATFORM_IS_WINDOWS
LOCK_BLOCK_FIXED_VER = "1.8.2"
LOCK_DOESNT_BLOCK = [RUBY_VERSION, LOCK_BLOCK_FIXED_VER]. map {|s| s.split('.')}.sort[0].join('.') == LOCK_BLOCK_FIXED_VER

Attributes

format  [RW] 

Public Instance methods

no flock() on WinME

Get an exclusive (i.e., write) lock on the file. If the lock is not available, wait for it without blocking other ruby threads.

Get a shared (i.e., read) lock on the file. If the lock is not available, wait for it without blocking other ruby threads.

[Validate]