• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: adding an executable as a resource
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >adding an executable as a resource (From: Ron Fleckner <email@hidden>)
 >Re: adding an executable as a resource (From: Markus Hitter <email@hidden>)

  • Prev by Date: Re: threads vs run-loops for keeping your GUI responsive
  • Next by Date: Re: run-time list of selectors in protocol?
  • Previous by thread: Re: adding an executable as a resource
  • Next by thread: Re: adding an executable as a resource
  • Index(es):
    • Date
    • Thread