Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
how is the current directory stored in linux?
int chdir(const char *path);
char *getcwd(char *buf, size_t size);
$ strace bash -c "cd /" 2>&1 | grep chdir
chdir("/") = 0
how is the current directory stored in linux?
stored in environment variables, in PWD variable
except for cd, set great via PWD="/"
This is done most correctly like this https://jsfiddle.net/0f9v8p6h/.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question