系统调用3--close
来源:互联网 发布:阿里云招聘官网首页 编辑:程序博客网 时间:2024/06/06 15:35
#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>/*******************************file:close.c*author:QG*time:2015-05-10*note:********************************/int main(){ char *pt = "./123.txt"; int a = 0; int b = 0; a = open(pt,O_WRONLY); if(a < 0) { printf("open file is fail!\n"); } else { printf("open file is success,descriptor is %d!\n",a); } /************************** *func:int close(int fd); *parametre: fd is the file's descriptor which will be closed! *return:close() returns zero on success, on error ,-1 is returned. *function: ****************************/ b = close(a); if(b == 0) { printf("close file is success!\n"); } else { printf("close file is fail!\n"); } return 0;}
0 0
- 系统调用3--close
- open,close系统调用
- 7.3 Close系统调用
- eCryptfs - close系统调用
- udp的close系统调用
- 系统调用 open close ioct1
- Linux系统调用之open(), close()
- Linux系统调用之open, close
- LinuxTCP shutdown和close系统调用
- QT中关于close()系统调用 和qt close()冲突
- Linux文件编程之【系统调用】——close()
- qt 应用程序中使用 close系统调用函数 注意问题
- linux文件编辑-系统调用—close()…
- 【Linux&Unix--open/close/write/read系统调用】
- Open、Read、Write、Lseek、Close、Create、Delete、chdir系统调用
- Linux&Unix--open/close/write/read系统调用】
- 【Linux&Unix--open/close/write/read系统调用】
- Nachos-3.4 系统调用 实现Create Open Read Write Close
- Scanner 调试时程序会结束,而运行时不会结束。
- spring4.0新特性综述
- POJ 1326 Mileage Bank(水~)
- python获取网站PR及百度权重
- 我看我自己系列1
- 系统调用3--close
- 第15周-阅读命名空间的使用
- android fragment的使用
- vb.net controls集合
- 系统调用 4--read
- javax.servlet.jsp.PageContext cannot be resolved to a type
- 系统调用 5--write
- Java内部类(二)局部内部类
- 谈Python多线程及程序锁