为了研究omfs文件系统是如何进行文件的write操作,我在应用层写了个小程序:
相关阅读:Linux文件系统omfs的目录创建和删除 http://www.linuxidc.com/Linux/2012-02/54025.htm Linux文件系统omfs的目录创建和删除 http://www.linuxidc.com/Linux/2012-02/54025.htmLinux文件系统omfs的普通文件创建和删除 http://www.linuxidc.com/Linux/2012-02/54026.htm#include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include <fcntl.h>#include <errno.h> Void main(){ Int I; Char w[16384]; Int fd; Int count; Fd = open(“/mnt/point1/cccc”,O_RDWR); Perror(“open”); For( I = 0; I < 16384; i++) { W[i] = 0x99;}Lseek(fd,0,SEEK_END);Count = write(fd,w,16384);Perror(“program”);Printf(“count: %d
”, count); } 这个程序的目的主要在于写入/mnt/point1/目录下的某个文件,而我们的omfs文件系统就挂载在该目录下。 目前该目录下的情况如下:ls –ali接下来我们对cccc这个文件写入16384个字节,每个字节都是0x99.
Linux文件系统omfs文件的重命名Linux 文件系统模块的注册相关资讯 Linux基础知识
- Linux基础知识之文件权限详解 (08月09日)
- Linux基础知识之ls与文件名通配详 (08月01日)
- Linux基础知识之history的详细说明 (07月31日)
| - Linux基础知识之文件管理命令(cp、 (08月09日)
- Linux基础知识之man手册的使用 (07月31日)
- Linux基础知识之文件的时间戳及 (07月31日)
|
本文评论 查看全部评论 (0)