From: Paul van Tilburg Date: 2003-04-27T07:08:16+09:00 Subject: Re: How do I change directories? On Sun, Apr 27, 2003 at 06:50:46AM +0900, Tim Heaney wrote: > Daniel Carrera writes: > > How do I change directory from a Ruby program? > > > > I tried 'system("cd #{dir}")' but it didn't work. > > Ruby has its own chdir; you don't have to ask the system to cd. And if you do, you spawn a shell which will chdir and exits afterwards, leaving nothing done... puts Dir.getwd system("cd #{dir}; pwd") puts Dir.getwd Paul -- Student @ Eindhoven | JID: paul@luon.net University of Technology, The Netherlands | email: paul@luon.net >>> Using the Power of Debian GNU/Linux <<< | GnuPG: finger paul@luon.net