文件操作 - ordered_list.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property/ordered_list.rb
编辑文件内容
# frozen_string_literal: true require_relative '../../puppet/property/list' module Puppet class Property # This subclass of {Puppet::Property} manages an ordered list of values. # The maintained order is the order defined by the 'current' set of values (i.e. the # original order is not disrupted). Any additions are added after the current values # in their given order). # # For an unordered list see {Puppet::Property::List}. # class OrderedList < List def add_should_with_current(should, current) if current.is_a?(Array) # tricky trick # Preserve all the current items in the list # but move them to the back of the line should += (current - should) end should end def dearrayify(array) array.join(delimiter) end end end end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件