|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
How to get the current application dir path in Carbon?
Hi All,
I am used to c and c++ stuff but I am new to the carbon framework. I want to know how to get current directory path in carbon and how to convert thar path to a const char*. Thanks. |
|
|
|
0
|
|
|
#2 |
|
You can still use Unixy features in a Carbon app on OS X (since OS X has a Unixy core deep down inside), just do the getcwd() call as if you were not using Carbon. Just add #include <unistd.h> and have at it.
__________________
Obama is a true statesman whose experience as a state senator, half-term US Senator & guest lecturer in a Constitutional Law class has fully prepared him to take control of our nuclear arsenal.-Me |
|
|
|
0
|
|
|
#3 |
|
"Current directory path" is quite a meaningless concept in Carbon applications. Better tell us what it actually is that you want to achieve.
|
|
|
|
0
|
|
|
#4 |
|
Would argv[0] include that information?
Todd |
|
|
|
0
|
|
|
#5 |
|
Hm, since the OP's title includes "current application dir path" I'm inclined to think he's referring to the path of his Carbon application. If so, you can use CFBundleCopyBundleURL(CFBundleGetMainBundle()) which returns a CFURLRef which points to the .app bundle.
|
|
|
|
0
|
|
|
#6 |
|
Thanks.
I am exactly refering to the carbon application bundle and yes CFBundleCopyBundleURL(CFBundleGetMainBundle()) is working fine. |
|
|
|
0
|
|
|
#7 |
|
|
0
|
|
|
#8 |
|
No. argv[0] typically contains the full path of the executable, but that's only a convention, not a requirement. The full path of the executable doesn't have anything to do with the current working directory. If it did, then /bin/pwd would never work.
|
|
|
|
0
|
|
|
#9 |
|
|
0
|
|
|
#10 |
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| TUTORIAL: How to get PCSX2 to run on Mac(without Bootcamp) | Mirrors | Mac Applications and Mac App Store | 21 | Mar 14, 2013 03:34 PM |
| Does anybody know how to get TweetTask? | xmelissaxmayhem | Jailbreaks and iOS Hacks | 3 | Jul 3, 2011 01:21 AM |
| How to get the path of bundle application | Tank2005 | Mac Programming | 2 | Jan 20, 2011 02:44 AM |
| Tip: How to get the Size column (and others) in Snow Leopard's search results list. | Casiotone | Mac OS X | 0 | Sep 3, 2009 10:32 PM |
| how to get the value of class variable in a non member function? | chidambaram | Mac Programming | 8 | Apr 10, 2008 11:13 PM |
All times are GMT -5. The time now is 09:34 AM.









.... is there is a function to do that ?
Linear Mode

