Solved

Set working dir to /.../mybundle.app/Resources

Posted on 2004-10-10
6
238 Views
Last Modified: 2013-12-26
I am having a Linux-Source which expects files in ./ relative to its executable... in order to change as little as possible I want to set working dir of my bundle to /.../mybundle.app/Resources.

Thank you!
0
Comment
Question by:Daij-Djan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 125 total points
ID: 12272074
Use the CFBundle APIs to determine the location of the bundle's Resources directory:
Specifically, CFBundleGetMainBundle() and CFBundleCopyResourcesDirectoryURL().
http://developer.apple.com/documentation/CoreFoundation/Reference/CFBundleRef/index.html

Use CFURLGetFileSystemRepresentation() to convert the returned URL to a file system path.
http://developer.apple.com/documentation/CoreFoundation/Reference/CFURLRef/Reference/function_group_3.html

Use chdir() to set the current working directory for the benefit of your ported Linux code.
man 2 chdir

0
 
LVL 5

Author Comment

by:Daij-Djan
ID: 12276587
the CorFoundation is objective C, no? can I simply call it from a c 'tool'
0
 
LVL 5

Author Comment

by:Daij-Djan
ID: 12276616
nevermind
0
 
LVL 23

Expert Comment

by:brettmjohnson
ID: 12277331
> the CorFoundation is objective C, no? can I simply call it from a c 'tool'

No, CoreFoundation is ANSI C.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question