Can a child process change the parent process's directory?

Can a child process change the parent process's directory?

Post by SR » Mon, 05 Apr 1999 05:00:00



A child process can not change the current directory of the parent because
the two processes have their own local environments.

The only exception is when you source one script from another. The sourced
script can change the current directory of the its parent. This is only
possible in scripts not C programs.


>hello all,
>As you know, use the chdir API can only change the directory
>of the current process.My problem is whether there is a method
>I can change the directory of the parent process,such as ksh.

>thanks,

>Li Xiaoming
>Automatic Parallelizing Compile Group
>Nanjing University,PR China


 
 
 

Can a child process change the parent process's directory?

Post by Li Xiaomin » Tue, 06 Apr 1999 04:00:00


hello all,
As you know, use the chdir API can only change the directory
of the current process.My problem is whether there is a method
I can change the directory of the parent process,such as ksh.

thanks,

Li Xiaoming
Automatic Parallelizing Compile Group
Nanjing University,PR China