文件操作 - digest.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/functions/digest.rb
编辑文件内容
# frozen_string_literal: true require_relative '../../../puppet/util/checksums' Puppet::Parser::Functions.newfunction(:digest, :type => :rvalue, :arity => 1, :doc => "Returns a hash value from a provided string using the digest_algorithm setting from the Puppet config file.") do |args| algo = Puppet[:digest_algorithm] Puppet::Util::Checksums.method(algo.intern).call args[0] end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件