PDA

View Full Version : QProcess problem when running on the N900


flgor
02-24-2010, 10:58 AM
Hello.

I have an application installed in two locations:

/usr/bin/myapp
/opt/myapp/bigprocess

Inside myapp installed in usr/bin i start the bigprocess from opt.

QProcess p;
p.start("/opt/myapp/bigprocess ", QStringList() << "/home/user/MyDoc/tmp/text.txt");

The bigprocess should create and fill the file text.txt with some data but ... it's empty.

when i run from command line the same command
/opt/myapp/bigprocess /home/user/MyDoc/tmp/text.txt my text is created and filled with data.

What do i do wrong?


Thanks

shadow12
02-24-2010, 11:16 AM
Dude if no one gives you an answer post the proggie and I will take a look. Never used QProcess but used subprocess in python so maybe I can help?

krk969
02-24-2010, 11:33 AM
Hello.
QProcess p;
p.start("/opt/myapp/bigprocess ", QStringList() << "/home/user/MyDoc/tmp/text.txt");

What do i do wrong?
Thanks

remove the trailing space after the process name when passing arguments, it should work :)
OR
p.start("/opt/myapp/bigprocess /home/user/MyDoc/tmp/text.txt");

flgor
02-24-2010, 02:13 PM
I still have the problem with the qprocess.

So now i set the output file to be in /opt/myapp
The installation add a text.txt in /opt/myapp/

In post installation i added:
chown -R user /opt/myapp/
chmod 777 /opt/myapp/*

But... when i'm running the process from code qprocess.start the output is always empty. I tried both ways start(path, argumenets) and start(" path and arguments in one string with spaces" )

When I'm running the process from command line on N900 the output text is filled.

on /opt/myapp/ls -la
i see the process as
rwxrwxrwx 1 user root

and the output file as
rwxrwxrwx 1 user root
------------


Thanks for help

TNiga
02-25-2010, 02:02 AM
Have you looked what kind of output does the process give when started?

QProcess p;
p.setStandardOutputFile("stdout.txt");
p.setStandardErrorFile("stderr.txt");
p.start("/opt/myapp/bigprocess", QStringList() << "/home/user/MyDoc/tmp/text.txt");

flgor
02-25-2010, 03:22 AM
thanks for the suggestion with the ErrorFile!!! At least now i know why it is not working