discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Find or determine an installed tool from my app and run it using NSB


From: Jamie Ramone
Subject: Re: Find or determine an installed tool from my app and run it using NSBundle and/or NSTask
Date: Tue, 23 Nov 2010 09:12:56 -0300

You can't use NSBundle for something like this as your tool is not
inside one. Remember: bundles are structured directories owned and
controled by your code, and a preexisting system-wide one is not. You
can, however, use NSTask for this purpose. Once set up you have the
complement of  the setLaunchPath: method, called launchPath to get
said info. But if you set it up the way you showed in the example,
chances are you already have that info. the method is much more
usefull when you created the launch path from separate strings and
lost them since, in my opinion.

As for the error you're getting I can't help as I don't know what's on
line 133 :P

On Sat, Nov 20, 2010 at 5:11 PM, Csanyi Pal <csanyipal@gmail.com> wrote:
> Hi,
>
> is it possible to find (using NSBundle) or determine (using NSTask) an
> installed tool (say this tool is installed in /usr/local/bin/ directory)
> and when get it's path, then run it from my app as a subtask?
>
> I'm trying this but without success:
> [code]
> NSTask *DPSetBit0;
> DPSetBit0 = [[NSTask alloc] init];
> [DPSetBit0 setLaunchPath: @"/usr/local/bin"];
> [DPSetBit0 launch];
> [/code]
>
> but when compiling get errors:
>  Compiling file MainController.m ...
> MainController.m: In function ‘-[MainController DPbitSetReset:]’:
> MainController.m:133: error: a label can only be part of a statement and
>  a declaration is not a statement
> make[3]: *** [obj/LPT_Interface.obj/MainController.m.o] Error 1
> make[2]: *** [internal-app-run-compile-submake] Error 2
> make[1]: *** [LPT_Interface.all.app.variables] Error 2
> make: *** [internal-all] Error 2
>
> --
> Regards, Paul Chany
> <http://sourceforge.net/projects/lptinterface/>
> <http://savannah.nongnu.org/projects/lpt-interface/>
> <http://csanyi-pal.info>
>
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
>



-- 
Besos, abrazos, confeti y aplausos.
Jamie Ramone
"El Vikingo"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]