- 博客(5)
- 收藏
- 关注
原创 open与fopen的区别
对于这两个名字很类似的函数,对于很多初学者来说,不容易搞清楚它们有什么不同,只知道按照函数用法使用。如果能很好的区分两者,相信大家对于C语言和UNIX系统(包括LINUX)有更深入的了解。在网上查找了一些资料,但是感觉不够全面,一些答案只是从某个角度阐述,所以让人觉得,这个也对,那个也对。但到底谁的表述更正确呢?其实都是对的,只是解释的视角不同罢了。下面结合个人的理解做一些梳理。1. 来源从来源的角度看,两者能很好的区分开,这也是两者最显而易见的区别:open是UNIX系统调用函数(包括LI
2021-01-13 23:19:08
219
原创 Linux下更改配置文件
#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include<string.h>#include<stdlib.h>#include<stdio.h>#include <unistd.h>int main(int argc,char **argv){ int fd; if(argc != 2) { printf("mei.
2021-01-12 23:43:48
269
原创 Linux实现CP命令
Linux实现CP命令#include<sys/types.h>#include<sys/stat.h>#include<fcntl.h>#include <unistd.h>#include<string.h>#include<stdlib.h>#include<stdio.h>int main(int argc,char**argv){ printf("%d\n",argc);
2021-01-10 23:34:44
244
原创 linux下open() read() write() lseek() close() 函数的用法
linux下open() read() write() lseek() close() 函数的用法open()函数的用法以下是函数的原型#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int open(const char *pathname, int flags); int open(con...
2021-01-10 20:39:24
856
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅