I have 2 threads running in paralel. The run function of the threads is as follows
public void run(){
Runtime rt = Runtime.getRuntime();
Process s;
try {
s = rt.exec("cd /.../somefolder/"+i+"/");
closeStream(s); // this closes process s
s = rt.exec("sh adapMs.sh");
closeStream(s); // this closes process s
} ...
}
adapMs.sh creates some folders, files .. under the current directory which is specified by the line
s = rt.exec("cd /.../somefolder/"+i+"/");
For example thread1 uses the directory 1. While thread1 uses the directory 1, another thread2 executes the line
s = rt.exec("cd /.../somefolder/"+i+"/");
which is directory 2.
Does this cause thread1 to create its new files under directory 2 or it creates it folders, files under directory 1 anyway?
in other words, does thread 2 cause to change thread1's current directory?