文件操作 - operating_system.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/3.2.0/rubygems/defaults/operating_system.rb
编辑文件内容
module Gem class << self ## # Remove methods we are going to override. This avoids "method redefined;" # warnings otherwise issued by Ruby. remove_method :default_path if method_defined? :default_path def puppet_vendor_dir path = if defined? RUBY_FRAMEWORK_VERSION then [ File.dirname(RbConfig::CONFIG['sitedir']), 'VendorGems' ] elsif RbConfig::CONFIG['rubylibprefix'] then [ RbConfig::CONFIG['rubylibprefix'], 'vendor_gems', ] else [ RbConfig::CONFIG['libdir'], 'ruby', 'vendor_gems', ] end @puppet_vendor_dir ||= File.join(*path) end def default_path path = [] path << user_dir if user_home && File.exist?(user_home) path << default_dir path << puppet_vendor_dir path << vendor_dir if vendor_dir and File.directory? vendor_dir path end end end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件