$15 GRAYBYTE WORDPRESS FILE MANAGER $92

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.23
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/ruby21/lib64/ruby/2.1.0/

HOME
Current File : /opt/alt/ruby21/lib64/ruby/2.1.0//tmpdir.rb
#
# tmpdir - retrieve temporary directory path
#
# $Id: tmpdir.rb 40825 2013-05-19 03:10:21Z ktsj $
#

require 'fileutils'
begin
  require 'etc.so'
rescue LoadError
end

class Dir

  @@systmpdir ||= defined?(Etc.systmpdir) ? Etc.systmpdir : '/tmp'

  ##
  # Returns the operating system's temporary file path.

  def Dir::tmpdir
    if $SAFE > 0
      tmp = @@systmpdir
    else
      tmp = nil
      for dir in [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp', '.']
        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" if !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)
      case prefix_suffix
      when String
        prefix = prefix_suffix
        suffix = ""
      when Array
        prefix = prefix_suffix[0]
        suffix = prefix_suffix[1]
      else
        raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}"
      end
      t = Time.now.strftime("%Y%m%d")
      path = "#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
      path << "-#{n}" if n
      path << suffix
    end

    def create(basename, *rest)
      if opts = Hash.try_convert(rest[-1])
        opts = opts.dup if rest.pop.equal?(opts)
        max_try = opts.delete(:max_try)
        opts = [opts]
      else
        opts = []
      end
      tmpdir, = *rest
      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


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.43 PM
root / root
0755
cgi
--
3 Mar 2024 10.43 PM
root / linksafe
0755
date
--
3 Mar 2024 10.43 PM
root / linksafe
0755
digest
--
3 Mar 2024 10.43 PM
root / linksafe
0755
dl
--
3 Mar 2024 10.43 PM
root / linksafe
0755
drb
--
3 Mar 2024 10.43 PM
root / linksafe
0755
fiddle
--
3 Mar 2024 10.43 PM
root / linksafe
0755
io
--
3 Mar 2024 10.43 PM
root / linksafe
0755
irb
--
3 Mar 2024 10.43 PM
root / linksafe
0755
json
--
3 Mar 2024 10.43 PM
root / linksafe
0755
matrix
--
3 Mar 2024 10.43 PM
root / linksafe
0755
net
--
3 Mar 2024 10.43 PM
root / linksafe
0755
openssl
--
3 Mar 2024 10.43 PM
root / linksafe
0755
optparse
--
3 Mar 2024 10.43 PM
root / linksafe
0755
psych
--
3 Mar 2024 10.43 PM
root / linksafe
0755
racc
--
3 Mar 2024 10.43 PM
root / linksafe
0755
rake
--
3 Mar 2024 10.53 PM
root / linksafe
0755
rbconfig
--
3 Mar 2024 10.43 PM
root / linksafe
0755
rdoc
--
3 Mar 2024 10.43 PM
root / linksafe
0755
rexml
--
3 Mar 2024 10.43 PM
root / linksafe
0755
rinda
--
3 Mar 2024 10.43 PM
root / linksafe
0755
ripper
--
3 Mar 2024 10.43 PM
root / linksafe
0755
rss
--
3 Mar 2024 10.43 PM
root / linksafe
0755
rubygems
--
3 Mar 2024 10.43 PM
root / linksafe
0755
shell
--
3 Mar 2024 10.43 PM
root / linksafe
0755
syslog
--
3 Mar 2024 10.43 PM
root / root
0755
test
--
3 Mar 2024 10.43 PM
root / linksafe
0755
uri
--
3 Mar 2024 10.43 PM
root / linksafe
0755
webrick
--
3 Mar 2024 10.43 PM
root / linksafe
0755
x86_64-linux
--
3 Mar 2024 10.43 PM
root / root
0755
xmlrpc
--
3 Mar 2024 10.43 PM
root / linksafe
0755
yaml
--
3 Mar 2024 10.43 PM
root / linksafe
0755
English.rb
6.443 KB
4 Feb 2013 2.50 AM
root / linksafe
0644
abbrev.rb
3.313 KB
21 Feb 2013 5.35 PM
root / linksafe
0644
base64.rb
2.631 KB
19 May 2013 3.10 AM
root / linksafe
0644
benchmark.rb
17.952 KB
20 Sep 2013 4.05 PM
root / linksafe
0644
cgi.rb
9.841 KB
18 Jul 2013 1.50 PM
root / linksafe
0644
cmath.rb
8.927 KB
3 Jul 2015 9.12 AM
root / linksafe
0644
complex.rb
0.371 KB
16 Aug 2009 3.34 PM
root / linksafe
0644
csv.rb
81.682 KB
14 Sep 2014 3.25 PM
root / linksafe
0644
date.rb
0.924 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
debug.rb
29.077 KB
14 Dec 2013 2.48 PM
root / linksafe
0644
delegate.rb
11.125 KB
2 Feb 2014 1.46 PM
root / linksafe
0644
digest.rb
2.338 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
dl.rb
0.273 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
drb.rb
0.019 KB
2 Oct 2009 10.45 AM
root / linksafe
0644
e2mmap.rb
3.891 KB
17 Dec 2013 11.20 AM
root / linksafe
0644
erb.rb
26.073 KB
11 Aug 2014 2.55 PM
root / linksafe
0644
expect.rb
2.144 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
fiddle.rb
1.652 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
fileutils.rb
47.171 KB
28 Apr 2015 5.16 AM
root / linksafe
0644
find.rb
2.359 KB
15 Oct 2014 3.31 PM
root / linksafe
0644
forwardable.rb
7.863 KB
23 May 2013 9.46 PM
root / linksafe
0644
getoptlong.rb
15.381 KB
19 May 2013 2.50 PM
root / linksafe
0644
gserver.rb
8.856 KB
6 Jul 2014 1.57 PM
root / linksafe
0644
ipaddr.rb
17.051 KB
29 Oct 2015 2.36 PM
root / linksafe
0644
irb.rb
20.034 KB
25 Mar 2016 8.22 AM
root / linksafe
0644
json.rb
1.737 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
kconv.rb
5.737 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
logger.rb
22.371 KB
25 Feb 2016 11.04 AM
root / linksafe
0644
mathn.rb
6.524 KB
26 Aug 2011 10.22 PM
root / linksafe
0644
matrix.rb
45.432 KB
11 Jul 2014 2.08 PM
root / linksafe
0644
mkmf.rb
80.503 KB
26 Jul 2023 2.19 PM
root / linksafe
0644
monitor.rb
6.935 KB
16 Nov 2012 4.55 PM
root / linksafe
0644
mutex_m.rb
2.002 KB
20 Feb 2013 2.51 AM
root / linksafe
0644
observer.rb
5.807 KB
21 Nov 2013 4.44 AM
root / linksafe
0644
open-uri.rb
24.268 KB
22 Feb 2014 8.54 AM
root / linksafe
0644
open3.rb
20.366 KB
1 Dec 2013 3.13 AM
root / linksafe
0644
openssl.rb
0.516 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
optparse.rb
50.796 KB
28 Nov 2013 7.34 AM
root / linksafe
0644
ostruct.rb
7.702 KB
23 Oct 2013 3.14 PM
root / linksafe
0644
pathname.rb
15.297 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
pp.rb
14.097 KB
22 Oct 2013 9.29 AM
root / linksafe
0644
prettyprint.rb
16.331 KB
19 May 2013 3.10 AM
root / linksafe
0644
prime.rb
13.203 KB
15 Jul 2013 4.21 AM
root / linksafe
0644
profile.rb
0.2 KB
2 Oct 2009 10.45 AM
root / linksafe
0644
profiler.rb
4.509 KB
19 May 2013 11.04 PM
root / linksafe
0644
pstore.rb
14.849 KB
11 Nov 2012 4.23 AM
root / linksafe
0644
psych.rb
14.878 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
rake.rb
2.116 KB
11 Oct 2013 9.35 PM
root / linksafe
0644
rational.rb
0.301 KB
24 Sep 2009 12.42 AM
root / linksafe
0644
rdoc.rb
4.921 KB
22 Dec 2013 10.25 AM
root / linksafe
0644
resolv-replace.rb
1.732 KB
11 Mar 2013 1.47 PM
root / linksafe
0644
resolv.rb
72.308 KB
13 May 2015 5.33 AM
root / linksafe
0644
ripper.rb
2.525 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
rss.rb
2.841 KB
11 May 2011 10.22 AM
root / linksafe
0644
rubygems.rb
30.974 KB
26 Jul 2023 2.19 PM
root / linksafe
0644
scanf.rb
23.542 KB
14 Dec 2013 2.55 AM
root / linksafe
0644
securerandom.rb
8.49 KB
7 Nov 2013 6.04 PM
root / linksafe
0644
set.rb
18.704 KB
22 Nov 2013 11.50 PM
root / linksafe
0644
shell.rb
10.299 KB
19 May 2013 3.10 AM
root / linksafe
0644
shellwords.rb
5.941 KB
14 Dec 2013 6.26 PM
root / linksafe
0644
singleton.rb
4.018 KB
18 May 2011 2.09 PM
root / linksafe
0644
socket.rb
25.596 KB
26 Jul 2023 2.22 PM
root / linksafe
0644
sync.rb
7.255 KB
19 May 2013 3.10 AM
root / linksafe
0644
tempfile.rb
11.398 KB
21 Nov 2013 9.28 AM
root / linksafe
0644
thwait.rb
3.377 KB
7 Nov 2013 5.02 PM
root / linksafe
0644
time.rb
21.316 KB
17 Aug 2015 7.41 AM
root / linksafe
0644
timeout.rb
3.697 KB
17 Aug 2015 7.55 AM
root / linksafe
0644
tmpdir.rb
4.149 KB
19 May 2013 3.10 AM
root / linksafe
0644
tracer.rb
6.402 KB
18 Jul 2013 1.50 PM
root / linksafe
0644
tsort.rb
14.145 KB
17 Oct 2013 3.59 PM
root / linksafe
0644
ubygems.rb
0.262 KB
2 Oct 2009 10.45 AM
root / linksafe
0644
un.rb
8.873 KB
5 Jul 2013 1.43 PM
root / linksafe
0644
uri.rb
3.07 KB
13 May 2011 8.03 PM
root / linksafe
0644
weakref.rb
3.229 KB
9 Nov 2013 10.42 PM
root / linksafe
0644
webrick.rb
6.689 KB
5 Oct 2013 11.39 PM
root / linksafe
0644
xmlrpc.rb
8.488 KB
12 Dec 2013 3.09 AM
root / linksafe
0644
yaml.rb
2.313 KB
12 Aug 2013 3.49 AM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF