how to get the location of a program
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=VE2NX8sijSEEWiNWgTLFXQNLhtCT8XsyjVCX4Ut1zHLYiWeFkCQoU7GYnUlMRLP1ka3va+U+KCjez2UIBg6R0lVFkzjUfcQG5b5jlEz3hdPuCMaQ/QFXn9J9DHRUzriSuMFmV4d0QdfsdG8KgByK50mDmPQeubw0bRn/rGE7vlM= ; Hi, Is there a way in OS X to get the full path of a program where it's being executed? I need to know the location where the user stores my program (along with some configuration files), to set up its running environment. Things like "getcwd" only work when you run the program in a Terminal. When you run it from Desktop or Finder, the "getcwd" gives the current user home directory.. "argv[0]" sometimes gives full path, but sometimes just gives the program's name itself.. Thank you very much for help! Best, Owen __________________________________ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
w.o.b