• 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
Include an executable without hard coding the path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Include an executable without hard coding the path


  • Subject: Include an executable without hard coding the path
  • From: Rick Schmidt <email@hidden>
  • Date: Fri, 17 Jul 2009 22:38:35 -0500

I'm sure this comes up a lot I'm just not sure what it is called.  I
need to include an executable in my project when it runs.  I right
clicked my project and added an existing file pointing to the
executable, but how to I reference it in my code without a hard coded
full file path to my local drive?  This is a bioinformatics app and I
am using a lot of executables from ncbi, so I can't plan on the user
having these installed in any /usr/bin for example.  Similarly how do
I have a path for the output to be saved in the program?
Example
NSTask *task;
task=[[NSTask alloc]init];
[task setLaunchPath:@"blastcl3"];

NSMutableArray *blastArgs=[NSMutableArray array];
[blastArgs addObject:@"-p"];
[blastArgs addObject:@"blastn"];
[blastArgs addObject:@"-i"];
[blastArgs addObject:inputPath];
[blastArgs addObject:@"-p"];
[blastArgs addObject:@"blastn"];
[blastArgs addObject:@"-d"];
[blastArgs addObject:@"nr"];
[blastArgs addObject:@"-o"];
[blastArgs addObject:@"~/out.txt"];

Thank you,
Rick
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Include an executable without hard coding the path
      • From: Marco S Hyman <email@hidden>
  • Prev by Date: Re: How to debug BetterAuthorizationSample
  • Next by Date: Re: Include an executable without hard coding the path
  • Previous by thread: Re: cgdb instead of gdb (or sudo gdb)
  • Next by thread: Re: Include an executable without hard coding the path
  • Index(es):
    • Date
    • Thread