def FileEntryExistsByPathSpec(self, path_spec):
    location = getattr(path_spec, u'location', None)

    if location is None:
      return False

    is_device = False
    if platform.system() == u'Windows':
      # Windows does not support running os.path.exists on device files
      # so we use libsmdev to do the check.
      try:
        is_device = pysmdev.check_device(location)
      except IOError as exception:
        # Since pysmdev will raise IOError when it has no access to the device
        # we check if the exception message contains ' access denied ' and
        # return true.

        # Note that exception.message no longer works in Python 3.
        exception_string = str(exception)
        if not isinstance(exception_string, py2to3.UNICODE_TYPE):
          exception_string = py2to3.UNICODE_TYPE(
              exception_string, errors=u'replace')

        if u' access denied ' in exception_string:
          is_device = True

    if not is_device and not os.path.exists(location):
      return False

    return True
Determines if a file entry for a path specification exists.
dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/vfs/os_file_system.py/OSFileSystem.FileEntryExistsByPathSpec