1 #include "apue.h"
 2 #include <fcntl.h>
 3 
 4 int main(void)
 5 {
 6     if(chdir("/home/zsf/book/unix/source_code/apue.3e/mycode/test") < 0)
 7         err_sys("chdir failed");
 8     printf("success chdri to /home/zsf/book/unix/source_code/apue.3e/mycode/test");
 9     creat("hello",O_RDWR);
10 
11     return 0;
12 }
13 ~     

chdir函数的使用【学习笔记】

 

相关文章: