def read_index_iter(self):
with fopen(self.vpk_path, '<STR_LIT:rb>') as f:<EOL><INDENT>f.seek(self.header_length)<EOL>while True:<EOL><INDENT>if self.version > <NUM_LIT:0> and f.tell() > self.tree_length + self.header_length:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>ext = _read_cstring(f)<EOL>if ext == '<STR_LIT>':<EOL><INDENT>break<EOL><DEDENT>while True:<EOL><INDENT>path = _read_cstring(f)<EOL>if path == '<STR_LIT>':<EOL><INDENT>break<EOL><DEDENT>if path != '<STR_LIT:U+0020>':<EOL><INDENT>path = os.path.join(path, '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>path = '<STR_LIT>'<EOL><DEDENT>while True:<EOL><INDENT>name = _read_cstring(f)<EOL>if name == '<STR_LIT>':<EOL><INDENT>break<EOL><DEDENT>(crc32,<EOL>preload_length,<EOL>archive_index,<EOL>archive_offset,<EOL>file_length,<EOL>suffix,<EOL>) = metadata = list(struct.unpack("<STR_LIT>", f.read(<NUM_LIT>)))<EOL>if suffix != <NUM_LIT>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if archive_index == <NUM_LIT>:<EOL><INDENT>metadata[<NUM_LIT:3>] = self.header_length + self.tree_length + archive_offset<EOL><DEDENT>metadata = (f.read(preload_length),) + tuple(metadata[:-<NUM_LIT:1>])<EOL>yield path + name + '<STR_LIT:.>' + ext, metadata<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Generator function that reads the file index from the vpk file

        yeilds (file_path, metadata)