code: def FileEntryExistsByPathSpec(self, path_spec):
      
      location = getattr(path_spec, 'location', None)
  
      if location is None:
        return False
  
      is_device = False
      if platform.system() == 'Windows':
        # Note that os.path.exists() returns False for Windows device files so
        # instead 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='replace')
  
          if ' access denied ' in exception_string:
            is_device = True
  
      # Note that os.path.exists() returns False for broken symbolic links hence
      # an additional check using os.path.islink() is necessary.
      return is_device or os.path.exists(location) or os.path.islink(location)
docs: Determines if a file entry for a path specification exists.
  
      Args:
        path_spec (PathSpec): a path specification.
  
      Returns:
        bool: True if the file entry exists, false otherwise.