Thread: Path
View Single Post
  #1 (permalink)  
Old September 15th, 2004, 04:56 PM
cavaleiro4 cavaleiro4 is offline
Registered User
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Path

  Hallo everybody!

  I'm having problems with paths. Actually, I am trying to do a system call, passing a file as parameter to a software called "wgnuplot.exe", which is located at C:\Documents and Settings\tmoutinho\gnuplot\bin\, this way:

/*code*/
String* path = S"C:\\Documents and Settings\\tmoutinho\\gnuplot\\bin\\Mytext.dat";
/* instructions building the file Mytext.dat*/
system("wgnuplot.exe C:\\Documents and Settings\\tmoutinho\\gnuplot\\bin\\Mytext.dat");
and it doesn't work.

However, changing the path where the file "Mytext.dat" is built to the path where the executable file is built:

/*code*/
String* path = S"C:\\Documents and Settings\\tmoutinho\\estat\\Debug\\Mytext.dat";
/* instructions building the file Mytext.dat*/
system("wgnuplot.exe "C:\\Documents and Settings\\tmoutinho\\estat\\Debug\\Mytext.dat";
and it works.

It seems that in a system call I only can pass a file as parameter if the one is built in the same path where it is located my executable file. But, can't I specify the path I want, building my text file where it is more convenient, or is it mandatory to build the text file in the same directory of my main executable file?

Thanks everyone!
            Thiago

Reply With Quote