getcwd problems

I get Permission denied errors when calling getcwd() in my home directory (or any of its subdirectories). I wrote a small program to check this ( http://pastie.caboo.se/72924) called cwd

The odd thing is that I can use the UNIX command pwd and the permissions on my directory do not seem odd.

lakshmi:~% whoami
ry
lakshmi:~% ls -ld /Users/ry
drwxr-xr-x 74 ry ry 2516 Jun 24 00:32 /Users/ry
lakshmi:~% cd ~
lakshmi:~% ~/cwd
Permission denied
lakshmi:~% cd Library
lakshmi:~/Library% ~/cwd
Permission denied
lakshmi:~/Library% cd /Users
lakshmi:/Users% ~/cwd
/Users
lakshmi:/Users% cd ~
lakshmi:~% pwd
/Users/ry


The problem has appeared randomly, possibly after an update to 10.4.10.

PowerBook G4 Mac OS X (10.4.10)

Mac OS X (10.4.10)

Posted on Jun 23, 2007 3:48 PM

Reply
1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

getcwd problems

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.