X7ROOT File Manager
Current Path:
/opt/alt/ruby24/lib64/ruby/2.4.0
opt
/
alt
/
ruby24
/
lib64
/
ruby
/
2.4.0
/
??
..
??
English.rb
(6.45 KB)
??
abbrev.rb
(3.49 KB)
??
base64.rb
(3.31 KB)
??
benchmark.rb
(17.9 KB)
??
cgi
??
cgi.rb
(9.8 KB)
??
cmath.rb
(9.48 KB)
??
csv.rb
(83.53 KB)
??
date.rb
(1004 B)
??
debug.rb
(29.98 KB)
??
delegate.rb
(10.31 KB)
??
digest
??
digest.rb
(2.83 KB)
??
drb
??
drb.rb
(50 B)
??
e2mmap.rb
(3.94 KB)
??
erb.rb
(27.25 KB)
??
expect.rb
(2.17 KB)
??
fiddle
??
fiddle.rb
(1.68 KB)
??
fileutils.rb
(44.06 KB)
??
find.rb
(2.52 KB)
??
forwardable
??
forwardable.rb
(8.5 KB)
??
getoptlong.rb
(15.41 KB)
??
io
??
ipaddr.rb
(17.1 KB)
??
irb
??
irb.rb
(20.29 KB)
??
json
??
json.rb
(1.77 KB)
??
kconv.rb
(5.77 KB)
??
logger.rb
(23.53 KB)
??
mathn.rb
(3.42 KB)
??
matrix
??
matrix.rb
(53.37 KB)
??
mkmf.rb
(84.32 KB)
??
monitor.rb
(7.02 KB)
??
mutex_m.rb
(2.04 KB)
??
net
??
observer.rb
(5.83 KB)
??
open-uri.rb
(24.76 KB)
??
open3.rb
(20.59 KB)
??
openssl
??
openssl.rb
(445 B)
??
optionparser.rb
(59 B)
??
optparse
??
optparse.rb
(57.25 KB)
??
ostruct.rb
(10.2 KB)
??
pathname.rb
(16.08 KB)
??
pp.rb
(14.43 KB)
??
prettyprint.rb
(15.89 KB)
??
prime.rb
(12.49 KB)
??
profile.rb
(236 B)
??
profiler.rb
(4.54 KB)
??
pstore.rb
(14.71 KB)
??
psych
??
psych.rb
(15.25 KB)
??
racc
??
rbconfig
??
rdoc
??
rdoc.rb
(5.07 KB)
??
resolv-replace.rb
(1.76 KB)
??
resolv.rb
(73.48 KB)
??
rexml
??
rinda
??
ripper
??
ripper.rb
(2.56 KB)
??
rss
??
rss.rb
(2.87 KB)
??
rubygems
??
rubygems.rb
(35.38 KB)
??
scanf.rb
(23.56 KB)
??
securerandom.rb
(7.48 KB)
??
set.rb
(20.74 KB)
??
shell
??
shell.rb
(11.37 KB)
??
shellwords.rb
(6.66 KB)
??
singleton.rb
(4.06 KB)
??
socket.rb
(42.99 KB)
??
sync.rb
(7.29 KB)
??
syslog
??
tempfile.rb
(10.8 KB)
??
thwait.rb
(3.35 KB)
??
time.rb
(22.36 KB)
??
timeout.rb
(3.83 KB)
??
tmpdir.rb
(4.29 KB)
??
tracer.rb
(6.44 KB)
??
tsort.rb
(14.3 KB)
??
ubygems.rb
(298 B)
??
un.rb
(9.18 KB)
??
unicode_normalize
??
unicode_normalize.rb
(3.2 KB)
??
uri
??
uri.rb
(3.1 KB)
??
weakref.rb
(2.95 KB)
??
webrick
??
webrick.rb
(6.72 KB)
??
x86_64-linux
??
yaml
??
yaml.rb
(1.73 KB)
Editing: tmpdir.rb
# frozen_string_literal: true # # tmpdir - retrieve temporary directory path # # $Id: tmpdir.rb 67153 2019-03-01 06:19:58Z usa $ # require 'fileutils' begin require 'etc.so' rescue LoadError # rescue LoadError for miniruby end class Dir @@systmpdir ||= defined?(Etc.systmpdir) ? Etc.systmpdir : '/tmp' ## # Returns the operating system's temporary file path. def self.tmpdir if $SAFE > 0 @@systmpdir.dup else tmp = nil [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp', '.'].each do |dir| next if !dir dir = File.expand_path(dir) if stat = File.stat(dir) and stat.directory? and stat.writable? and (!stat.world_writable? or stat.sticky?) tmp = dir break end rescue nil end raise ArgumentError, "could not find a temporary directory" unless tmp tmp end end # Dir.mktmpdir creates a temporary directory. # # The directory is created with 0700 permission. # Application should not change the permission to make the temporary directory accessible from other users. # # The prefix and suffix of the name of the directory is specified by # the optional first argument, <i>prefix_suffix</i>. # - If it is not specified or nil, "d" is used as the prefix and no suffix is used. # - If it is a string, it is used as the prefix and no suffix is used. # - If it is an array, first element is used as the prefix and second element is used as a suffix. # # Dir.mktmpdir {|dir| dir is ".../d..." } # Dir.mktmpdir("foo") {|dir| dir is ".../foo..." } # Dir.mktmpdir(["foo", "bar"]) {|dir| dir is ".../foo...bar" } # # The directory is created under Dir.tmpdir or # the optional second argument <i>tmpdir</i> if non-nil value is given. # # Dir.mktmpdir {|dir| dir is "#{Dir.tmpdir}/d..." } # Dir.mktmpdir(nil, "/var/tmp") {|dir| dir is "/var/tmp/d..." } # # If a block is given, # it is yielded with the path of the directory. # The directory and its contents are removed # using FileUtils.remove_entry before Dir.mktmpdir returns. # The value of the block is returned. # # Dir.mktmpdir {|dir| # # use the directory... # open("#{dir}/foo", "w") { ... } # } # # If a block is not given, # The path of the directory is returned. # In this case, Dir.mktmpdir doesn't remove the directory. # # dir = Dir.mktmpdir # begin # # use the directory... # open("#{dir}/foo", "w") { ... } # ensure # # remove the directory. # FileUtils.remove_entry dir # end # def self.mktmpdir(prefix_suffix=nil, *rest) base = nil path = Tmpname.create(prefix_suffix || "d", *rest) {|pth, _, _, d| base = d mkdir(pth, 0700) } if block_given? begin yield path ensure unless base stat = File.stat(File.dirname(path)) if stat.world_writable? and !stat.sticky? raise ArgumentError, "parent directory is world writable but not sticky" end end FileUtils.remove_entry path end else path end end module Tmpname # :nodoc: module_function def tmpdir Dir.tmpdir end def make_tmpname((prefix, suffix), n) prefix = (String.try_convert(prefix) or raise ArgumentError, "unexpected prefix: #{prefix.inspect}") prefix = prefix.delete("#{File::SEPARATOR}#{File::ALT_SEPARATOR}") suffix &&= (String.try_convert(suffix) or raise ArgumentError, "unexpected suffix: #{suffix.inspect}") suffix &&= suffix.delete("#{File::SEPARATOR}#{File::ALT_SEPARATOR}") t = Time.now.strftime("%Y%m%d") path = "#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}".dup path << "-#{n}" if n path << suffix if suffix path end def create(basename, tmpdir=nil, max_try: nil, **opts) if $SAFE > 0 and tmpdir.tainted? tmpdir = '/tmp' else origdir = tmpdir tmpdir ||= tmpdir() end n = nil begin path = File.join(tmpdir, make_tmpname(basename, n)) yield(path, n, opts, origdir) rescue Errno::EEXIST n ||= 0 n += 1 retry if !max_try or n < max_try raise "cannot generate temporary name using `#{basename}' under `#{tmpdir}'" end path end end end
Upload File
Create Folder