def gettextfile(remotefile, localfile = File.basename(remotefile)) # :yield: line
      result = nil
      if localfile
        f = open(localfile, "w")
      elsif !block_given?
        result = ""
      end
      begin
	retrlines("RETR " + remotefile) do |line|
	  f.puts(line) if localfile
	  yield(line) if block_given?
          result.concat(line + "\n") if result
	end
        return result
      ensure
	f.close if localfile
      end
    end
def gettextfile(remotefile, localfile = File.basename(remotefile)) # :yield: line
      result = nil
      if localfile
        f = open(localfile, "w")
      elsif !block_given?
        result = ""
      end
      begin
	retrlines("RETR " + remotefile) do |line|
	  f.puts(line) if localfile
	  yield(line) if block_given?
          result.concat(line + "\n") if result
	end
        return result
      ensure
	f.close if localfile
      end
    end
Retrieves +remotefile+ in ASCII (text) mode, storing the result in
 +localfile+.
 If +localfile+ is nil, returns retrieved data.
 If a block is supplied, it is passed the retrieved data one
 line at a time.