[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Running a command using NSTask
From: |
Csanyi Pal |
Subject: |
Re: Running a command using NSTask |
Date: |
Sun, 21 Nov 2010 13:57:06 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Hi Truls,
Truls Becken <truls.becken@gmail.com> writes:
> On Sun, Nov 21, 2010 at 11:58, Csanyi Pal wrote:
>
> You replaced:
>
>> [DPSetBit0 setLaunchPath: @"/usr/local/bin/DPSetBit0"];
>
> with just a copy of a method signature:
>
>> (NSString*) launchPathForTool: (NSString*)DPSetBit0;
>
> I think what you wanted was:
>
> [DPSetBit0 setLaunchPath: [NSTool launchPathForTool: @"DPSetBit0"]];
I replaced the line
(NSString*) launchPathForTool: (NSString*)DPSetBit0;
with (used instead of NSTool the NSTask method):
[DPSetBit0 setLaunchPath: [NSTask launchPathForTool: @"DPSetBit0"]];
> Note that this method is a GNUstep addition, not available on OS X.
I shall use methods you adviced to me for OS X using:
#ifdef __APPLE__
// get a list of the directories the program might be in
// NSSearchPathForDirectoriesInDomains()
// append your program name to each directory in turn
// [NSString-stringByAppendingPathComponent:]
// check each to see if the program is there
// [NSFileManager-isExecutableFileAtPath:]
#endif /* __APPLE__ */
but first I must study these methods so I can use these too.
Any advices will be appreciated regarding this task.
--
Regards, Paul Chany
<http://sourceforge.net/projects/lptinterface/>
<http://savannah.nongnu.org/projects/lpt-interface/>
<http://csanyi-pal.info>