Advertisement

Getting current Directory name

Started by September 05, 2005 12:40 AM
1 comment, last by Schmacker 19 years, 1 month ago
Hey, Im doing a project at Uni right now that involves linux system calls, which, being mostly a windows person, I am having a bit of trouble with. What I want to do is find out what the current working directory is so that I can display it on the screen. Is this possible? how would one do it? Where should I look for guidence? Ive looked at some of the man pages, but couldn't find any that helped me out. cheers in advance for anything useful
Assuming you are using C, try getcwd(3).

If you are talking about the shell, try pwd (works on bash, might apply to other shells as well).
Jooleem. Get addicted.
Advertisement
thanks very much, not only for the answer, but for the timeliness :) Im using c++, which I probably should of mentioned, so this should work nicely :)

Thanks again

This topic is closed to new replies.

Advertisement