文件操作 - response.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/response.rb
编辑文件内容
# frozen_string_literal: true class Puppet::Network::HTTP::Response def initialize(handler, response) @handler = handler @response = response end def respond_with(code, type, body) format = Puppet::Network::FormatHandler.format_for(type) mime = format.mime charset = format.charset if charset if body.is_a?(String) && body.encoding != charset body.encode!(charset) end mime += "; charset=#{charset.name.downcase}" end @handler.set_content_type(@response, mime) @handler.set_response(@response, body, code) end end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件