On May 30, 2011, at 8:45 AM, Vyacheslav Karamov wrote:

>  NSString * listsPath = STR_ADDPATH([[NSBundle mainBundle] resourcePath], 
> @"lists.zip");

What is STR_ADDPATH?  There's already Cocoa API for what it looks like it does:

NSString *listsPath = [[NSBundle mainBundle] pathForResource:@"lists" 
ofType:@"zip"];

In general you shouldn't try to reinvent or wrap Cocoa's APIs.

>   NSArray * args = [NSArray arrayWithObjects:@"-a ", listsPath, @" -d ", 
> sharedPath, nil];

NSTask does not perform any shell interpretation on the arguments you give it; 
you do not need to use spaces, quotes, etc. in them.

This is general to Unix-based operating systems:  Only a very few APIs (such as 
the system(3) function) do any sort of argument interpretation.  In general, if 
you're dealing with an array of arguments, that's the array that will be copied 
(via the execve(2) or posix_spawn(2) functions) over to the other program's 
main() function.

  -- Chris

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to