(self, number, start, stop, allow_self=True, read_only=False)
Attempt to access a record.
Attempt to access a record.
Attempt to access a record .
def _try_record_lock(self, number, start, stop, allow_self=True, read_only=False):
        """Attempt to access a record."""
        this_file = self._locking_parameters[number]
        other_locks = [
            f.lock_set for f in self.list_open(this_file.name, number if allow_self else None)
            # access parameter only exists to allow reading a record on locked OUTPUT file
            if not (f.mode in b'OA' and read_only)
        ]
        other_lock_set = set.union(*other_locks) if other_locks else set()
        # access in violation of other's LOCK#: permission denied
        # whole-file access sought
        if stop is None and start is None:
            if other_lock_set:
                raise error.BASICError(error.PERMISSION_DENIED)
        else:
            # range access sought
            for start_1, stop_1 in other_lock_set:
                if (
                        stop_1 is None and start_1 is None
                        or (start >= start_1 and start <= stop_1)
                        or (stop >= start_1 and stop <= stop_1)
                    ):
                    raise error.BASICError(error.PERMISSION_DENIED)
def _try_record_lock ( self , number , start , stop , allow_self = True , read_only = False ) : this_file = self . _locking_parameters [ number ] other_locks = [ f . lock_set for f in self . list_open ( this_file . name , number if allow_self else None ) # access parameter only exists to allow reading a record on locked OUTPUT file if not ( f . mode in b'OA' and read_only ) ] other_lock_set = set . union ( * other_locks ) if other_locks else set ( ) # access in violation of other's LOCK#: permission denied # whole-file access sought if stop is None and start is None : if other_lock_set : raise error . BASICError ( error . PERMISSION_DENIED ) else : # range access sought for start_1 , stop_1 in other_lock_set : if ( stop_1 is None and start_1 is None or ( start >= start_1 and start <= stop_1 ) or ( stop >= start_1 and stop <= stop_1 ) ) : raise error . BASICError ( error . PERMISSION_DENIED )