def BuildIntermediateDirectories(self):
    for dirname, (_, stat) in self.paths.items():
      pathspec = stat.pathspec
      while 1:
        dirname = os.path.dirname(dirname)

        new_pathspec = pathspec.Copy()
        new_pathspec.path = os.path.dirname(pathspec.path)
        pathspec = new_pathspec

        if dirname == "/" or dirname in self.paths: break

        self.paths[dirname] = ("VFSDirectory",
                               rdf_client.StatEntry(st_mode=16877,
                                                    st_size=1,
                                                    st_dev=1,
                                                    pathspec=new_pathspec))
Interpolate intermediate directories based on their children.
dataset/ETHPy150Open google/grr/grr/lib/test_lib.py/ClientVFSHandlerFixture.BuildIntermediateDirectories