Dir.chdir

It seems that the class method “Dir.chdir” can’t be used to implemnt
the Unix command cd, because it can only change the working directory
of the current process. Is that right?

Can someone suggest a good way to do the same thing as the Unix cd
command?

Thanks.

Hi,

···

In message “Dir.chdir” on 03/01/15, TOTO zhoujing@comp.nus.edu.sg writes:

It seems that the class method “Dir.chdir” can’t be used to implemnt
the Unix command cd, because it can only change the working directory
of the current process. Is that right?

Can someone suggest a good way to do the same thing as the Unix cd
command?

Unfortunately, there’s no way to change other process’s current
working directory from outside. ‘the Unix cd command’ is a shell
builtin.

						matz.

It seems that the class method “Dir.chdir” can’t be used to implemnt
the Unix command cd, because it can only change the working directory
of the current process. Is that right?

Can someone suggest a good way to do the same thing as the Unix cd
command?

they are the same, actually.
$PWD is an internal variable of the shell, the same way as in ruby.

···

On 14 Jan 2003 23:54:51 -0800, zhoujing@comp.nus.edu.sg (TOTO) wrote:

Thanks.