• 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: FW: How to change path where Cocoa App is runnin?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FW: How to change path where Cocoa App is runnin?


  • Subject: Re: FW: How to change path where Cocoa App is runnin?
  • From: Sherm Pendley <email@hidden>
  • Date: Mon, 25 Mar 2002 17:40:23 -0500

On Monday, March 25, 2002, at 04:02 PM, Alberto wrote:

Because the UNIX app has some config files, that are located in the same
path that binaries.

That's a badly written, nonstandard UNIX app - it should be looking in /etc for global settings, and in the current user's home directory for per-user settings.

If you can, you should address the problem instead of the symptoms. The UNIX app should be fixed, so that it looks in the standard locations for config files instead of where it's currently expecting to find them.

So.. how to change path "where Cocoa app runs" ?

If I understand you correctly, you don't need to change the working directory for the Cocoa app, you need to change it for the UNIX app. As I said above, you're dealing with a broken UNIX app - you shouldn't need to do this.

To begin with, if you're using system() to launch the UNIX app, have a look at NSTask. You should be using that, not system().

The NSTask method "setCurrentDirectoryPath:" will do what you want.

sherm--
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >FW: How to change path where Cocoa App is runnin? (From: Alberto <email@hidden>)

  • Prev by Date: Re: Focus ring around NSTableView
  • Next by Date: Re: Low-level File Access
  • Previous by thread: Re: How to change path where Cocoa App is runnin?
  • Next by thread: Re: How to change path where Cocoa App is runnin?
  • Index(es):
    • Date
    • Thread