return [] // Nothing was written to this bucket.
self._fobj.close()
path = self._path
res = []
with tf.io.gfile.GFile(path, "rb") as fobj:
while True:
buff = fobj.read(HKEY_SIZE_BYTES)
if not buff:
break
hkey = _read_hkey(buff)
size_bytes = fobj.read(8)
size = struct.unpack("=Q", size_bytes)[0]
data = fobj.read(size)
res.append((hkey, data))return res
def del_file(self):
if tf.io.gfile.exists(self._path):
tf.io.gfile.remove(self._path)
After Change
size_bytes = fobj.read(8)
size = struct.unpack("=Q", size_bytes)[0]
data = fobj.read(size)
yield hkey, data
def del_file(self):
if tf.io.gfile.exists(self._path):
tf.io.gfile.remove(self._path)