Linux open函数使用方法记录

一、做用linux linux一切皆文件,那么如何打开文件,靠的就是open函数。打开和建立文件,对于文件来讲存在文件则打开,不存在则建立;对于设备,能够打开相应设备(串口,SPI,I2C等)。函数 二、函数原型code //包含头文件 #include <fcntl.h> int open(const char *pathname, int oflag, ... ); 返回值:成功则返回文件描述
相关文章
相关标签/搜索