def GetFileEntryByPathSpec(self, path_spec):
    tsk_vs_part, partition_index = tsk_partition.GetTSKVsPartByPathSpec(
        self._tsk_volume, path_spec)

    location = getattr(path_spec, u'location', None)

    # The virtual root file has not corresponding TSK volume system part object
    # but should have a location.
    if tsk_vs_part is None:
      if location is None or location != self.LOCATION_ROOT:
        return
      return dfvfs.vfs.tsk_partition_file_entry.TSKPartitionFileEntry(
          self._resolver_context, self, path_spec, is_root=True,
          is_virtual=True)

    if location is None and partition_index is not None:
      path_spec.location = u'/p{0:d}'.format(partition_index)

    return dfvfs.vfs.tsk_partition_file_entry.TSKPartitionFileEntry(
        self._resolver_context, self, path_spec)
Retrieves a file entry for a path specification.
dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/vfs/tsk_partition_file_system.py/TSKPartitionFileSystem.GetFileEntryByPathSpec