U:RDoc::AnyMethod[iI" mktmpdir:EFI"Dir::mktmpdir;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"0Dir.mktmpdir creates a temporary directory.;To:RDoc::Markup::BlankLineo; ; [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, prefix_suffix.;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:RDoc::Markup::Verbatim; [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: @format0o; ; [I"2The directory is created under Dir.tmpdir or ;TI"Jthe optional second argument tmpdir 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") { ... } ;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") { ... } ;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" path;T[I"(prefix_suffix=nil, *rest);T@QFI"Dir;TcRDoc::NormalClass00