From: Mathieu Bouchard Date: 2001-03-11T04:56:08+09:00 Subject: [ruby-talk:12394] Re: RCR: Block form of Dir.chdir On Wed, 7 Mar 2001, Robert Feldt wrote: > I frequently do something like > prev_dir = Dir.pwd > Dir.chdir(new_dir) > # work in new_dir... > Dir.chdir(prev_dir) > There is probably a better way to do it somewhere in the Standard lib but > what about adding a block form to Dir.chdir so that you can do > Dir.chdir(new_dir) { > # work in new_dir... > } Sounds good to me. If File.open can, why not this one. matju