Quantcast
Viewing latest article 8
Browse Latest Browse All 20

How to properly execute commands using only the API

Hi, I'm using Titanium Desktop and am converting my app to only use javascript and the Titanium API (right now I am also dependant on PHP, which I want to deprecate).

I've already converted everything, apart from 2 commands which I run in php with shell_exec. The Titanium API has a more or less equivalent function with Titanium.Process.createProcess, only it seems quite limited in the way that it takes arguments.

I am trying to run the following process:

"echo 'foo' > /tmp/bar &"

But I find it impossible to execute this using the Titanium API, I can execute the echo, but there's no way I can make it write the output to /tmp/bar without having the Titanium API take care of this part as well. The reason I don't want to take care of this in Javascript is because I will take a serious performance hit (keep in mind the above command is just an example).

Any ideas?

Thank you


Viewing latest article 8
Browse Latest Browse All 20

Trending Articles