Re: Best way to launch command-line program from C++ application
Re: Best way to launch command-line program from C++ application
- Subject: Re: Best way to launch command-line program from C++ application
- From: David Gagnon <email@hidden>
- Date: Fri, 20 Mar 2009 16:48:50 -0400
- Thread-topic: Best way to launch command-line program from C++ application
Hi,
Our program is a C++ plug-in for Acrobat. So, we need to launch a
command-line program to send HTTP message (sending HTTP message within a
plug-in cause many problems). Our small command line program take 1
parameter (path) and return an error value. So, I tried "exec" but it does
not work, because Acrobat is multi-process. See this link:
http://factor-language.blogspot.com/2007/07/execve-returning-enotsup-on-mac-
os-x.html
Also, posix_spawn could be a nice choice but it is available in 10.5 only.
So I think that "system" or "popen" are the most credible candidate now.
Have a better/simpler idea?
Thanks!
David
On 09-03-19 16:57, "Dave Carrigan" <email@hidden> wrote:
>
> On Mar 19, 2009, at 1:48 PM, David Gagnon wrote:
>
>> What is the best/easiest way to launch a command-line program from
>> our C++ application? I know how to do it using ³System.framework²
>> but it is a bit complicated. I need a function like ³ShellExecute²
>> on PC... ;-)
>
> If it's objective-c++ you could use NSTask.
>
> There is also Launch Services, which I think comes closest to
> ShellExecute, depending on how you're using ShellExecute.
>
> For straight C++ with a true command line program you can likely use
> fork/exec.
>
> Give us a better idea of what exactly you need to do, and we can tell
> you which of those options is better.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden