PDA

View Full Version : Help with QProcess!!



afflictedd2
28th March 2009, 17:50
Hi everyone,

I've been working with this problem a while now :\.

Somehow I'm trying to do this that I would in a command line like this: "suxwigb < hseis.out clip=1.0"

In the program the code I use to achieve this looks like this:


void MainWindow::view()
{
textEdit_2->clear();
// Setting the Environment for Seismic Unix
QStringList env = QProcess::systemEnvironment();
env << "CWPROOT=" + environment;
suxwigb.setEnvironment(env);

QStringList args;

args << "clip=1.0"
;

suxwigb.setStandardInputFile("hseis.out");
suxwigb.setWorkingDirectory( QDir::current().currentPath() );
suxwigb.start("suxwigb", args);
}


The funny thing is that.. this works on linux works on Linux and and inside Contents of the MacOS application Prog.app/Contents/MacOS/Prog

but when I try calling that action when I open the program through "open Prog.app", it will not work !!!

and I get this error:

xwigb: subcalls.c: efopen: fopen failed /dev/tty, w
suxwigb process crashed

Any ideas what's happening???

Thanks in advance,

Ed.

talk2amulya
28th March 2009, 19:14
looks like another instance of process suxwigb is running and using hseis.out..causing fopen to not work and crashing ur app..

afflictedd2
28th March 2009, 19:52
Seems unlikely, I only call it once in the program, but do you mean the error I'm seeing is because the file hseis.out maybe in use by another program?

talk2amulya
28th March 2009, 20:34
fopen cant open it, so most probably file's in use i guess

wysota
28th March 2009, 22:56
I'd say the problem is in using a relative path to the input file. The working directory is probably different when starting the application using open and using console and the file can't be found.