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

 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 ~     

 

posted @ 2017-06-08 18:06  请给我倒杯茶  阅读(691)  评论(0编辑  收藏  举报