Active Topics

 


Reply
Thread Tools
Posts: 34 | Thanked: 2 times | Joined on Feb 2010
#1
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.

Code:
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

Last edited by flgor; 2010-02-24 at 16:06.
 
Posts: 102 | Thanked: 22 times | Joined on Oct 2009
#2
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's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#3
Originally Posted by flgor View Post
Hello.
Code:
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");
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”
 

The Following User Says Thank You to krk969 For This Useful Post:
Posts: 34 | Thanked: 2 times | Joined on Feb 2010
#4
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
 
Posts: 353 | Thanked: 263 times | Joined on Dec 2009 @ Finland
#5
Have you looked what kind of output does the process give when started?

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

The Following 2 Users Say Thank You to TNiga For This Useful Post:
Posts: 34 | Thanked: 2 times | Joined on Feb 2010
#6
thanks for the suggestion with the ErrorFile!!! At least now i know why it is not working
 
Reply


 
Forum Jump


All times are GMT. The time now is 04:59.