Re: Problem getting correct file URL in NSTask process
Re: Problem getting correct file URL in NSTask process
- Subject: Re: Problem getting correct file URL in NSTask process
- From: Antonio Nunes <email@hidden>
- Date: Thu, 27 May 2010 13:19:18 +0100
On 27 May 2010, at 13:15, Ken Thomases wrote:
> If, in a shell, you were to invoke a command like:
>
> /path/to/some/command -f /path/to/file
>
> Then the program would receive "-f" and "/path/to/file" as separate arguments. To achieve the same thing with NSTask, you'd pass @"-f" and @"/path/to/file" as two separate elements of the argument array.
>
> You've now switched to the equivalent of:
>
> /path/to/some/command -f/path/to/file
>
> That works in this case, but relies on the program you're invoking parsing apart the option switch from its value. Apparently, that assumption holds for the program in question. I just wanted to make sure you understood how to replicate the original form using NSTask.
Thanks,
I wondered about that actually, but had not tried sending the arguments separately yet. I'll make these changes, as you have made it clear that that is a more robust way to pass the arguments.
Best,
António
----------------------------------------------------
Disapprove of sin but not of the sinner
----------------------------------------------------
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden