def realpath(path)
      path = Pathname.new(path) unless path.is_a?(Pathname)

      # Explicitly DON'T run #pathname here. We don't want to convert
      # to Windows directory separators because we're comparing these
      # against the paths returned by Listen, which use forward
      # slashes everywhere.
      begin
        path.realpath
      rescue SystemCallError
        # If [path] doesn't actually exist, don't bail, just
        # return the original.
        path
      end
    end
def realpath(path)
      path = Pathname.new(path) unless path.is_a?(Pathname)

      # Explicitly DON'T run #pathname here. We don't want to convert
      # to Windows directory separators because we're comparing these
      # against the paths returned by Listen, which use forward
      # slashes everywhere.
      begin
        path.realpath
      rescue SystemCallError
        # If [path] doesn't actually exist, don't bail, just
        # return the original.
        path
      end
    end
Returns `path` with all symlinks resolved.

 @param path [String, Pathname]
 @return [Pathname]