public function writeLock() { if (!flock($this->dataHandle, LOCK_EX | LOCK_NB) || !index::lock($this->table)) { throw new Exception('Unable to obtain dat file lock.'); } return true; }