# File lib/listen/directory_record.rb, line 192
    def relative_to_base(path)
      path = path.force_encoding("BINARY") if path.respond_to?(:force_encoding)
      relative_path = Pathname.new(path).relative_path_from(Pathname.new directory).to_s
      relative_path unless relative_path.start_with?('..')
    end