PATH:
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Dir
U:RDoc::AnyMethod[iI" mktmpdir:ETI"Dir::mktmpdir;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"0Dir.mktmpdir creates a temporary directory.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"require 'tmpdir' ;TI"Dir.mktmpdir {|dir| ;TI" # use the directory ;TI"} ;T:@format0o; ; [I"4The directory is created with 0700 permission. ;TI"nApplication should not change the permission to make the temporary directory accessible from other users.;T@o; ; [I"HThe prefix and suffix of the name of the directory is specified by ;TI"7the optional first argument, <i>prefix_suffix</i>.;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"TIf it is not specified or nil, "d" is used as the prefix and no suffix is used.;To;;0; [o; ; [I"GIf it is a string, it is used as the prefix and no suffix is used.;To;;0; [o; ; [I"cIf it is an array, first element is used as the prefix and second element is used as a suffix.;T@o;; [I"-Dir.mktmpdir {|dir| dir is ".../d..." } ;TI"6Dir.mktmpdir("foo") {|dir| dir is ".../foo..." } ;TI"BDir.mktmpdir(["foo", "bar"]) {|dir| dir is ".../foo...bar" } ;T; 0o; ; [I"2The directory is created under Dir.tmpdir or ;TI"Jthe optional second argument <i>tmpdir</i> if non-nil value is given.;T@o;; [I"7Dir.mktmpdir {|dir| dir is "#{Dir.tmpdir}/d..." } ;TI"CDir.mktmpdir(nil, "/var/tmp") {|dir| dir is "/var/tmp/d..." } ;T; 0o; ; [ I"If a block is given, ;TI"3it is yielded with the path of the directory. ;TI"0The directory and its contents are removed ;TI"?using FileUtils.remove_entry before Dir.mktmpdir returns. ;TI"(The value of the block is returned.;T@o;; [ I"Dir.mktmpdir {|dir| ;TI" # use the directory... ;TI"< open("#{dir}/foo", "w") { something using the file } ;TI"} ;T; 0o; ; [I"If a block is not given, ;TI",The path of the directory is returned. ;TI"=In this case, Dir.mktmpdir doesn't remove the directory.;T@o;; [ I"dir = Dir.mktmpdir ;TI"begin ;TI" # use the directory... ;TI"< open("#{dir}/foo", "w") { something using the file } ;TI"ensure ;TI" # remove the directory. ;TI"" FileUtils.remove_entry dir ;TI"end;T; 0: @fileI"lib/tmpdir.rb;T:0@omit_headings_from_table_of_contents_below00I"dup;T[ I"2(prefix_suffix=nil, *rest, **options, &block);T@WFI"Dir;TcRDoc::NormalClass00
[-] each_child-i.ri
[edit]
[-] cdesc-Dir.ri
[edit]
[-] fchdir-c.ri
[edit]
[-] children-c.ri
[edit]
[-] delete-c.ri
[edit]
[-] mktmpdir-c.ri
[edit]
[-] getwd-c.ri
[edit]
[-] rewind-i.ri
[edit]
[-] new-c.ri
[edit]
[-] mkdir-c.ri
[edit]
[-] unlink-c.ri
[edit]
[-] chroot-c.ri
[edit]
[-] rmdir-c.ri
[edit]
[-] home-c.ri
[edit]
[-] chdir-c.ri
[edit]
[-] seek-i.ri
[edit]
[-] exist%3f-c.ri
[edit]
[-] to_path-i.ri
[edit]
[-] close-i.ri
[edit]
[-] each-i.ri
[edit]
[-] pos-i.ri
[edit]
[-] open-c.ri
[edit]
[-] glob-c.ri
[edit]
[-] path-i.ri
[edit]
[-] chdir-i.ri
[edit]
[-] empty%3f-c.ri
[edit]
[+]
..
[-] pos%3d-i.ri
[edit]
[-] tmpdir-c.ri
[edit]
[-] pwd-c.ri
[edit]
[-] for_fd-c.ri
[edit]
[-] read-i.ri
[edit]
[-] children-i.ri
[edit]
[-] inspect-i.ri
[edit]
[-] each_child-c.ri
[edit]
[-] %5b%5d-c.ri
[edit]
[-] entries-c.ri
[edit]
[-] tell-i.ri
[edit]
[-] fileno-i.ri
[edit]
[-] foreach-c.ri
[edit]