Used the function chdir() to change the work directory of the child process.