handleCopyIn (sample/psql.rb)

    # File sample/psql.rb, line 537
    def handleCopyIn(settings, mustprompt, copystream)
      copydone = FALSE

      if mustprompt
        STDOUT.print("Enter info followed by a newline\n")
        STDOUT.print("End with a backslash and a ")
        STDOUT.print("period on a line by itself.\n")
      end

      while !copydone
        if mustprompt
          STDOUT.print(">> ")
          STDOUT.flush
        end

        copybuf = copystream.gets
        if copybuf == nil
          settings.db.putline("\\.\n")
          copydone = TRUE
          break
        end
        settings.db.putline(copybuf)
        if copybuf == "\\.\n"
          copydone = TRUE
        end
      end
      settings.db.endcopy
    end