Lines Matching refs:pos
51 # "%r, (%d, %d)\n" % (key, pos, siz)
52 # where key is the string key, pos is the offset into the dat
65 self._index = None # maps keys to (pos, siz) pairs
119 pos, siz = self._index[key] # may raise KeyError
121 f.seek(pos)
133 pos = int(f.tell())
134 npos = ((pos + _BLOCKSIZE - 1) // _BLOCKSIZE) * _BLOCKSIZE
135 f.write('\0'*(npos-pos))
136 pos = npos
139 return (pos, len(val))
141 # Write val to the data file, starting at offset pos. The caller
143 # pos to hold val, without overwriting some other value. Return
144 # pair (pos, len(val)).
145 def _setval(self, pos, val):
147 f.seek(pos)
150 return (pos, len(val))
153 # at offset pos and with length siz. Add an index record to
170 pos, siz = self._index[key]
174 self._index[key] = self._setval(pos, val)