Re: NSTask
Re: NSTask
- Subject: Re: NSTask
- From: Shawn Erickson <email@hidden>
- Date: Tue, 7 Oct 2003 08:42:10 -0700
On Tuesday, October 7, 2003, at 07:51 AM, April Gendill wrote:
yes I understand that, which is why i have an array, the problem is
when I pass an argument like
-arg param
this is what doesn't work.
just an array of arguments works fine
You need to understand what delimitates a argument on the command line.
Typing...
> sometool<space>-arg<space>param
...results in two array entries in argv inside the tool's main routine.
In other words it get two entries and has to understand that they are
related on its own.
NSTask follows this convention in that you have to pass two separate
arguments since the command tool is expecting two separate (granted
related) arguments.
One way that may help you think about this... for every element in the
array you pass to NSTask consider it to be double quoted on the command
line if you where to type it out.
So passing in an array entry of -agr<space>param to NSTask equates with
"-agr<space>param" on the command line. While passing in -arg and param
as two separate array entries equates with "-arg" "param". The former
would not be what the tool was expecting while the later is.
-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >Re: NSTask (From: April Gendill <email@hidden>) |