D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Dir
/
Filename :
chdir-i.ri
back
Copy
U:RDoc::AnyMethod[iI" chdir:ETI"Dir#chdir;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"5Changes the current working directory to +self+:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"Dir.pwd # => "/" ;TI"dir = Dir.new('example') ;TI"dir.chdir ;TI"Dir.pwd # => "/example" ;T:@format0o; ; [I"=With a block, temporarily changes the working directory:;T@o:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0; [o; ; [I"Calls the block.;To;;0; [o; ; [I"$Changes to the given directory.;To;;0; [o; ; [I")Executes the block (yields no args).;To;;0; [o; ; [I"-Restores the previous working directory.;To;;0; [o; ; [I"&Returns the block's return value.;T@o; ; [I"CUses Dir.fchdir if available, and Dir.chdir if not, see those ;TI"methods for caveats.;T: @fileI" dir.c;T:0@omit_headings_from_table_of_contents_below0I"(chdir -> 0 chdir { ... } -> object ;T0[ I"();T@7FI"Dir;TcRDoc::NormalClass00