文件操作 - terminal.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/terminal.rb
编辑文件内容
# frozen_string_literal: true module Puppet::Util::Terminal # Attempts to determine the width of the terminal. This is currently only # supported on POSIX systems, and relies on the claims of `stty` (or `tput`). # # Inspired by code from Thor; thanks wycats! # @return [Number] The column width of the terminal. Defaults to 80 columns. def self.width if Puppet.features.posix? result = %x(stty size 2>/dev/null).split[1] || %x(tput cols 2>/dev/null).split[0] end (result || '80').to_i rescue 80 end end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件