Page 1 of 1

[SOLVED]Current directory name

Posted: Mon Jan 11, 2010 9:13 pm
by Quipeace
Hey,

I'm creating a simple terminal like file browser and until now I've been tracking the current directory name by hand, however, running "cd .." would result in a "current directory" called "/dir/.." instead of "/".

So I was wondering, how would I get the current directory name? (similar to something like readdir I suppose)

Re: Current directory name

Posted: Tue Jan 12, 2010 1:34 pm
by WinterMute
getcwd

Re: Current directory name

Posted: Tue Jan 12, 2010 1:52 pm
by Quipeace
Thank you very much, I appreciate it :), I'll try it as soon as I get home.

EDIT: Works perfectly :)