文件操作 - functions.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/resolvers/solaris/ffi/functions.rb
编辑文件内容
# frozen_string_literal: true module Facter module Resolvers module Solaris module FFI module Ioctl extend ::FFI::Library ffi_lib ::FFI::Library::LIBC, 'socket' attach_function :ioctl_base, :ioctl, %i[int int pointer], :int attach_function :open_socket, :socket, %i[int int int], :int attach_function :close_socket, :close, %i[int], :int attach_function :inet_ntop, %i[int pointer pointer uint], :string def self.ioctl(call_const, pointer, address_family = AF_INET) fd = Ioctl.open_socket(address_family, SOCK_DGRAM, 0) begin ioctl_base(fd, call_const, pointer) ensure Ioctl.close_socket(fd) end end end end end end end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件