Hi Everyone, its been a little while since i posted, been lurking though!
I'm writing a short program to try and sift through a mountain of data from some simulation results.
Basically, the user inputs some values corresponding to some variables in the schematic and it should change to the appropriate directory where the data is and plot a file.
The problem i'm having is that i get to where the user inputs data and i change to the directory but it doesn't stay in the directory. Is it possible to get it to do this?
Some brief code may help explain:
Code:
if(width < 10)
{
printf("cd 2amp/eps/3m6to10m\n");
system("cd 2amp/eps/3m6to10m");
}
else
if(width < 20)
{
printf("cd 2amp/eps/10mto20m\n");
system("cd 2amp/eps/10mto20m");
}
and so on.. if i do:
Code:
system("cd 2amp/eps/10mto20m/; pwd")
I get the right directory but if i do:
Code:
system("cd 2amp/eps/10mto20m/")
system("pwd")
It prints the directory the program is in so i know its going in to the directory but coming straight back out. Is there a way to keep it into the directory once its in?
Or should i save the directory address as a variable to do later?
Thanks in advance for your time,
Simon.