该chdir
函数会更改目录,但不会更改原始目录。
例如:
$ pwd
~/home/loganaayahee
$ cc chdir
$ ./a.out ~/Desktop
The directory change sucess and the current dir is ~/Desktop
$ pwd
~/home/loganaayahee
shell 不会更改目录。是什么原因?所以我确实改变了原来的目录我做什么?chdir() 函数的用途是什么?
该chdir
函数会更改目录,但不会更改原始目录。
例如:
$ pwd
~/home/loganaayahee
$ cc chdir
$ ./a.out ~/Desktop
The directory change sucess and the current dir is ~/Desktop
$ pwd
~/home/loganaayahee
shell 不会更改目录。是什么原因?所以我确实改变了原来的目录我做什么?chdir() 函数的用途是什么?