X7ROOT File Manager
Current Path:
/opt/alt/ruby23/lib64/ruby/2.3.0
opt
/
alt
/
ruby23
/
lib64
/
ruby
/
2.3.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
(82.15 KB)
📄
date.rb
(1011 B)
📄
debug.rb
(29.97 KB)
📄
delegate.rb
(10.29 KB)
ðŸ“
digest
📄
digest.rb
(2.82 KB)
ðŸ“
drb
📄
drb.rb
(50 B)
📄
e2mmap.rb
(3.8 KB)
📄
erb.rb
(26.45 KB)
📄
expect.rb
(2.17 KB)
ðŸ“
fiddle
📄
fiddle.rb
(1.68 KB)
📄
fileutils.rb
(47.47 KB)
📄
find.rb
(2.51 KB)
📄
forwardable.rb
(7.97 KB)
📄
getoptlong.rb
(15.41 KB)
ðŸ“
io
📄
ipaddr.rb
(17.08 KB)
ðŸ“
irb
📄
irb.rb
(20.06 KB)
ðŸ“
json
📄
json.rb
(1.77 KB)
📄
kconv.rb
(5.77 KB)
📄
logger.rb
(21.93 KB)
📄
mathn.rb
(3.87 KB)
ðŸ“
matrix
📄
matrix.rb
(53.37 KB)
📄
mkmf.rb
(83.79 KB)
📄
monitor.rb
(7.01 KB)
📄
mutex_m.rb
(2.03 KB)
ðŸ“
net
📄
observer.rb
(5.83 KB)
📄
open-uri.rb
(24.61 KB)
📄
open3.rb
(20.67 KB)
ðŸ“
openssl
📄
openssl.rb
(445 B)
📄
optionparser.rb
(59 B)
ðŸ“
optparse
📄
optparse.rb
(56.91 KB)
📄
ostruct.rb
(9.95 KB)
📄
pathname.rb
(16.08 KB)
📄
pp.rb
(14.2 KB)
📄
prettyprint.rb
(15.89 KB)
📄
prime.rb
(12.35 KB)
📄
profile.rb
(236 B)
📄
profiler.rb
(4.54 KB)
📄
pstore.rb
(14.58 KB)
ðŸ“
psych
📄
psych.rb
(15.29 KB)
📄
psych_jars.rb
(175 B)
ðŸ“
racc
ðŸ“
rbconfig
ðŸ“
rdoc
📄
rdoc.rb
(5.07 KB)
📄
resolv-replace.rb
(1.76 KB)
📄
resolv.rb
(73.52 KB)
ðŸ“
rexml
ðŸ“
rinda
ðŸ“
ripper
📄
ripper.rb
(2.56 KB)
ðŸ“
rss
📄
rss.rb
(2.87 KB)
ðŸ“
rubygems
📄
rubygems.rb
(32.24 KB)
📄
scanf.rb
(23.56 KB)
📄
securerandom.rb
(7.49 KB)
📄
set.rb
(19.67 KB)
ðŸ“
shell
📄
shell.rb
(11.33 KB)
📄
shellwords.rb
(6.28 KB)
📄
singleton.rb
(4.05 KB)
📄
socket.rb
(43.49 KB)
📄
sync.rb
(7.29 KB)
ðŸ“
syslog
📄
tempfile.rb
(10.87 KB)
📄
thwait.rb
(3.34 KB)
📄
time.rb
(22.28 KB)
📄
timeout.rb
(3.68 KB)
📄
tmpdir.rb
(4.17 KB)
📄
tracer.rb
(6.43 KB)
📄
tsort.rb
(14.3 KB)
📄
ubygems.rb
(299 B)
📄
un.rb
(8.87 KB)
ðŸ“
unicode_normalize
📄
unicode_normalize.rb
(3.19 KB)
ðŸ“
uri
📄
uri.rb
(3.1 KB)
📄
weakref.rb
(2.95 KB)
ðŸ“
webrick
📄
webrick.rb
(6.72 KB)
ðŸ“
x86_64-linux
ðŸ“
xmlrpc
📄
xmlrpc.rb
(8.93 KB)
ðŸ“
yaml
📄
yaml.rb
(1.73 KB)
Editing: tmpdir.rb
# frozen_string_literal: true # # tmpdir - retrieve temporary directory path # # $Id: tmpdir.rb 62995 2018-03-28 10:29:15Z 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 Dir.mktmpdir(prefix_suffix=nil, *rest) path = Tmpname.create(prefix_suffix || "d", *rest) {|n| mkdir(n, 0700)} if block_given? begin yield path ensure stat = File.stat(File.dirname(path)) if stat.world_writable? and !stat.sticky? raise ArgumentError, "parent directory is world writable but not sticky" 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 tmpdir ||= tmpdir() end n = nil begin path = File.join(tmpdir, make_tmpname(basename, n)) yield(path, n, opts) 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