• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
xjc147896325
博客园 首页 新随笔 联系 订阅 订阅 管理

2020年11月5日

linux中open函数
摘要: open函数用来打开一个设备,他返回的是一个整型变量,如果这个值等于-1,说明打开文件出现错误,如果为大于0的值 参考格式 if(fd=open("/dev/ttys0",O_RDWR | O_NOCTTY | O_NDELAY))<0 {printf("cannot open"}; int ope 阅读全文
posted @ 2020-11-05 16:29 jOKERII 阅读(1225) 评论(0) 推荐(1)
 
Linux里的stat_1
摘要: 作用: 显示文件或文件系统的状态 头文件: #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> 函数定义: int stat(const char *path, struct stat *buf); int fstat(i 阅读全文
posted @ 2020-11-05 16:19 jOKERII 阅读(135) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3