文件操作 - exists.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/confine/exists.rb
编辑文件内容
# frozen_string_literal: true require_relative '../../puppet/confine' class Puppet::Confine::Exists < Puppet::Confine def self.summarize(confines) confines.inject([]) { |total, confine| total + confine.summary } end def pass?(value) value && (for_binary? ? which(value) : Puppet::FileSystem.exist?(value)) end def message(value) "file #{value} does not exist" end def summary result.zip(values).each_with_object([]) { |args, array| val, f = args; array << f unless val; } end end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件