其他分享
首页 > 其他分享> > rename、remove

rename、remove

作者:互联网

/***
remove.c
***/
#include<stdio.h>

int main()
{
    remove("./b.txt");
}

运行结果:

ubuntu1604@ubuntu:~/wangqinghe/C/20190728$ gedit remove.c b.txt

^C

ubuntu1604@ubuntu:~/wangqinghe/C/20190728$ gcc remove.c -o remove

ubuntu1604@ubuntu:~/wangqinghe/C/20190728$ ls

a.txt  b.txt  flush.  flush.c  remove  remove.c

ubuntu1604@ubuntu:~/wangqinghe/C/20190728$ ./remove

ubuntu1604@ubuntu:~/wangqinghe/C/20190728$ ls

a.txt  flush.  flush.c  remove  remove.c

 

/***
rename.c
***/
#include<stdio.h>

int main()
{
    rename("./a.txt","./b.txt");
    return 0;
}

运行结果:

ubuntu1604@ubuntu:~/wangqinghe/C/20190728$ ./rename

ubuntu1604@ubuntu:~/wangqinghe/C/20190728$ ls

b.txt  flush.  flush.c  remove  remove.c  rename  rename.c

标签:rename,remove,20190728,ubuntu,wangqinghe,txt,ubuntu1604
来源: https://www.cnblogs.com/wanghao-boke/p/11260821.html