openframeworks / openframeworks/openFrameworks
ofFilePath::getCurrentWorkingDirectory() doesn't change on OSX
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
So getCurrentWorkingDirectory() always returns the executable dir on OS X: https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/utils/ofFileUtils.cpp#L1637
This is actually not very useful since:
- it doesn't actually return the current working directory ie.
chdir()does't effect it - there is already an ofFilePath::getCurrentExeDir()
I mainly noticed this since I have an app where I need to change the current working directory and couldn't figure out why it "wasn't" working. Later on I noticed this implementation and switched to getcwd() which confirmed that chdir() was working fine.
I propose removing the defined OS X specific code here.
(EDIT: Also, why is it "getCurrentWorkingDirectory()" and "getCurrentExeDir()"? Shouldn't that be "getCurrentExeDirectory()"?)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with libs/openFrameworks/utils/ofFileUtils.cpp at the linked getCurrentWorkingDirectory() implementation, then compare it with getCurrentExeDir(). Verify the behavior of chdir() and getcwd() on OS X. Done means the working-directory function reflects the process working directory and the requested naming concern is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100