文件操作 - execution_stub.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/execution_stub.rb
编辑文件内容
# frozen_string_literal: true module Puppet::Util class ExecutionStub class << self # Set a stub block that Puppet::Util::Execution.execute() should invoke instead # of actually executing commands on the target machine. Intended # for spec testing. # # The arguments passed to the block are |command, options|, where # command is an array of strings and options is an options hash. def set(&block) @value = block end # Uninstall any execution stub, so that calls to # Puppet::Util::Execution.execute() behave normally again. def reset @value = nil end # Retrieve the current execution stub, or nil if there is no stub. def current_value @value end end end end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件