Getting current working directory
Getting current working directory
- Subject: Getting current working directory
- From: Tony Scaminaci <email@hidden>
- Date: Sun, 28 Jan 2007 12:35:20 -0600
Hi,
I'm trying to programatically get and save the current working
directory using a low-level system call. They key points are that I
need to store the path string for later use and whatever system call
I use must be available in single-user mode. Using a call like system
("/bin/pwd") displays the path to stdout but I can't figure out how
to redirect the string to a character array for later concatenation.
Since the string already exists in the PWD env variable, is there
some way to read that in a C program? I'm not sure the latter is the
best way though since the user's shell may be different than bash.
I've been searching the online docs for hours and haven't found a way
to do this yet.
Thanks,
Tony
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden