O_DSYNC:

每次write都等待物理I/O完成,但是如果写操作不影响读取刚写入的数据,则不等待文件属性更新

O_RSYNC:

每个以文件描述符作为参数的read操作等待,直到所有对文件同一部分的未决写操作完成

O_SYNC:

每次write都等到物理I/O完成,包括write引起的文件属性的更新

  • O_SYNC: requires that any write operations block until all data and all metadata have been written to persistent storage.
  • O_DSYNC: like O_SYNC, except that there is no requirement to wait for any metadata changes which are not necessary to read the just-written data. In practice, O_DSYNC means that the application does not need to wait until ancillary information (the file modification time, for example) has been written to disk. Using O_DSYNC instead of O_SYNC can often eliminate the need to flush the file inode on a write.
  • O_RSYNC: this flag, which only affects read operations, must be used in combination with either O_SYNC or O_DSYNC. It will cause aread() call to block until the data (and maybe metadata) being read has been flushed to disk (if necessary). This flag thus gives the kernel the option of delaying the flushing of data to disk; any number of writes can happen, but data need not be flushed until the application reads it back.

文件打开方式O_DSYNC、O_RSYNC、O_SYNC的更多相关文章

  1. 转载:python文件打开方式详解——a、a+、r+、w+区别

    第一步 排除文件打开方式错误: r只读,r+读写,不创建      ###f.readline()是读取第一行,f.readlines()是读取全部并返回一个列表 w新建只写,w+新建读写,会将文件内 ...

  2. python文件打开方式详解——a、a+、r+、w+区别

    出处: http://blog.csdn.net/ztf312/ 第一步 排除文件打开方式错误: r只读,r+读写,不创建 w新建只写,w+新建读写,二者都会将文件内容清零 (以w方式打开,不能读出. ...

  3. Python的with语句(文件打开方式)

    Python文件打开方式(with语句) python编程中对于文件的打开方式主要有以下两种: 1.利用直接性的open("","")函数:(举例说明) try ...

  4. 【转】python文件打开方式详解——a、a+、r+、w+区别

    原文地址:http://blog.csdn.net/ztf312/article/details/47259805 第一步 排除文件打开方式错误: r只读,r+读写,不创建 w新建只写,w+新建读写, ...

  5. 万恶技术系列笔记-jupyter工作路径和源文件打开方式

    万恶技术系列笔记-jupyter工作路径和源文件打开方式   脚本文件,ipynb的正确打开姿势: ipynb不能直接打开,需要复制到工作路径.例如 10_monkeys_model_1.ipynb ...

  6. .jnlp 文件打开方式

    .jnlp 文件打开方式 jnlp文件打开需要安装jre ,java环境,通过java环境运行即可,下面介绍详细步骤 1.下载.安装最新版jre环境,直接下一步即可 2 java配置 打开控制面板,查 ...

  7. windows中LNK文件打开方式恢复(每日一修(1))

    相信有些用户曾试过错误地把LNK文件的打开方式更改其他文件,导致系统所有的快捷方式都失效.在vista与Windows7系统还不普遍使用的时候,相信大家会有点惊慌失措,不要紧,下面只要大家进行如下操作 ...

  8. Python文件处理之文件打开方式(一)

    Python中打开一个文件是同过open函数来打开的,并返回一个文件对象,以下为open函数的参数: open(name[, mode[buf]]) name:文件路径 mode:打开方式 buf:缓 ...

  9. Linux 中改变默认文件打开方式的位置

    全局的打开方式, /etc/gnome/defaults.list 个人的打开方式, -/.local/share/applications/mimeapps.list 当这两个文件不一致时,优先采用 ...

随机推荐

  1. 操作系统课堂笔记(2)操作系统的硬件环境之I/O技术和时钟

    I/O技术 1.程序控制I/O技术 有处理器提供相关的IO指令来实现的.主要缺陷是,处理器必须关注IO处理单元的状态,因而它会耗费大量的时间轮询以获得这个信息,这严重降低了系统性能. 2.中断驱动I/ ...

  2. Ubuntu下开启root登陆

    亲手安装过Ubuntu的童鞋都知道,默认安装只会添加一个普通用户名和密码,而超级用户权限则是利用sudo命令来执行.在Ubuntu下使用root登陆或者在shell中用su命令切换到root时会提示错 ...

  3. Extended ComboBox添加图标

    Extended ComboBox添加图标 关键点 实现过程 // MFC02Dlg.h : header fileCImageList m_imageList;  // MFC02Dlg.cpp : ...

  4. Android内存、性能是程序永恒的话题

    内存.性能是程序永恒的话题,实际开发中关于卡顿.OOM也经常是打不完的两只老虎,关于卡顿.OOM的定位方法和工具比较多,这篇文章也不打算赘述了,本章主要是来整理一下JVM的内存模型以及Java对象的生 ...

  5. uuid_short() 源代码

    /* uuid_short handling. The short uuid is defined as a longlong that contains the following bytes: B ...

  6. Servlet中字节字符流的输出

    public class OutServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServ ...

  7. start mysqld on Mac server

    #!/bin/sh # Source the common setup functions for startup scripts test -r /etc/rc.common || exit 1 . ...

  8. modelsim remote

    远程桌面登陆我的台式机上的账号,然后运行modelsim 出现该问题: Unable to checkout a viewer license necessary for use of the Mod ...

  9. jQuery导航菜单防刷新

    为了实现最主要的功能,只写了一个粗糙的案例 CSS样式 ul,li{ list-style-type:none;} .nav { width: 100%; height: 35px; line-hei ...

  10. ThinkPHP函数详解:I方法

    ThinkPHP的I方法是3.1.3版本新增的,如果你是之前的3.*版本的话,可以直接参考使用3.1快速入门教程系列的变量部分. 概述 正如你所见到的一样,I方法是ThinkPHP众多单字母函数中的新 ...