[英]How do i write a program that opens an exe file(spectrawin) and saves the data into a specific name and folder?
I'm using c++. 我正在使用c ++。 How do i write a program that opens an exe file(spectrawin) and saves the data into a specific name and folder?
如何编写打开exe文件(spectrawin)并将数据保存到特定名称和文件夹的程序?
Cheers 干杯
This will make a directory called Output, and pipe the output from your executable into a file called output.txt, inside that Output directory. 这将创建一个名为Output的目录,并将可执行文件的输出通过管道传递到该Output目录中的一个名为output.txt的文件。
mkdir ("Output");
chdir ("Output");
system ("spectrawin > output.txt");
Please note that I do not know what spectrawin does. 请注意,我不知道Spectrumwin会做什么。 The above code works with an exe that outputs to the console.
上面的代码与输出到控制台的exe一起使用。
Incidentally, if you need to know where your working directory currently is, use something like: 顺便说一句,如果您需要知道当前的工作目录在哪里,请使用类似以下的命令:
char workingDir [_MAX_PATH];
_getcwd( workingDir, _MAX_PATH );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.