不带缓存的文件I/O操作 open/close
来源:互联网 发布:基德级与现代级 知乎 编辑:程序博客网 时间:2024/05/16 01:50
open.c
#include <unistd.h>#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
int fd;
if((fd=open("/WIN_UBUNTU/sample/open/opentest.c",O_CREAT|O_TRUNC|O_WRONLY,0600))<0)
{
perror("open:");
exit(1);
}
else
{
printf("open file: opentest.c %d\n", fd);
}
if(close(fd)<0)
{
perror("close:");
exit(1);
}
else
{
printf("close file: opentest.c %d\n", fd);
}
exit(0);
}
Makefile
obj=open.o
open:$(obj)gcc $(obj) -o open
open.o:open.c
gcc -c open.c
clean:
rm $(obj) open opentest.c
- 不带缓存的文件I/O操作 open/close
- 【文件】不带缓存的文件I/O操作函数之creat、open
- 不带缓存的文件I/O操作 read/write
- 不带缓存的文件I/O操作 fcntl
- 不带缓存的文件I/O操作
- 不带缓存操作的I/O操作(1)
- Linux下的文件操作(不带缓存的I/O操作)
- 不带缓存的I/O操作(2)
- 带缓存的流文件I/O操作
- 用带缓存的I/O操作写文件粘贴
- 不带缓存的IO函数open() write() close()
- Linux 系统 I/O编程-----不带缓存的I/O操作
- Linux 系统 I/O编程-----不带缓存的I/O操作
- 带缓存的和不带缓存的I/O操作
- 文件I/O操作----带与不带缓冲的I/O
- liunx--文件----不带I/o缓冲的操作
- 不带缓冲的文件I/O操作
- 带缓存的I/O操作
- node-webkit框架学习
- 编程调用Revit自己提供的命令
- C的题-sizeof
- linux驱动子系统--设备树
- android 使用TCP通信demo
- 不带缓存的文件I/O操作 open/close
- 2.3 Customizing the UISwitch
- Oracle中的Union、Union All、Intersect、Minus 排序
- 出现了内部错误,Internet Explorer无法打印该文档
- 设计技巧26:状态模式 State 用类来表示一个状态
- hdu 1222 Wolf and Rabbit 数论,线性同余方程的一般运用
- js中字符替换函数String.replace()使用技巧
- 设计技巧27:代理 Proxy 为另外一个对象提供替身或者站位符以控制对对象的访问
- hdu 3342 拓扑排序 水