Re: adding an executable as a resource
Re: adding an executable as a resource
- Subject: Re: adding an executable as a resource
- From: Rosyna <email@hidden>
- Date: Sat, 10 Dec 2005 02:09:02 +0900
Ack, at 12/9/05, Markus Hitter said:
You could get away with 3 lines (roughly):
No, you couldn't. At least not like this..
char * command[MAX_PATH * 2];
You have an array of pointers. I think you mean char command[MAX_PATH*2];
sprintf(command, "%s/Resources/lame %s", [[[NSBundle
mainBundle] bundlePath] UTF8String], filename);
1. Your hard coded path lacks Contents.
2. You should be using pathForResource:
3. You don't quote the path or the parameters so this would break if
there is a space in any of these paths.
4. fileSystemRepresentation, not UTF8String.
5. NSTask is better.
system(command);
There is no way to get output from this. The NSTask method would be
the most correct way to do this in cocoa. The other way is to just
link to the lame library and call its functions but that would
require being opensourced.
--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden