Set working dir to /.../

Posted on 2004-10-10
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 /.../

Thank you!
Question by:Daij-Djan
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
LVL 23

Accepted Solution

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().

Use CFURLGetFileSystemRepresentation() to convert the returned URL to a file system path.

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


Author Comment

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

Author Comment

ID: 12276616
LVL 23

Expert Comment

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

No, CoreFoundation is ANSI C.


Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 54
Error on moodle after upgrade 3 155
Making an alias 7 121
listing all the respondents to a twitter feed - Java 5 48
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below.…

739 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