system actually starts a new process, does what you want, then closes that process. in fact, if you really think about it, what does it mean to "change directory"; "change directory" or cd is a Shell implemented feature on the *system* level. With this in mind, you're best bet is to use the standard unix library.
#include <unistd.h>
and the function chdir(char *path)
man chdir
man getcwd
system is the worst function of all time, never use it.
Last edited by subtronic; Aug 23rd, 2003 at 2:56 am.