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. Codeforces Round #306 (Div. 2) ABCDE(构造)

    A. Two Substrings 题意:给一个字符串,求是否含有不重叠的子串"AB"和"BA",长度1e5. 题解:看起来很简单,但是一直错,各种考虑不周全, ...

  2. Java和.NET的GZIP压缩功能对比

    本文主要比较了Java和.NET提供的GZIP压缩功能. 介绍 在本文中,我们将讨论Java和.NET提供的GZIP压缩功能,并且用实例来说明哪个压缩方法更佳. 在Java中,我们有提供GZIP压缩的 ...

  3. storm出现的背景

     storm出现的背景 互联网从诞生的第一时间起,对世界的最大改变就是让信息能够实时交互,从而大大加速了各个环节的效率.正因为大家有对信息实时响应.实时交互的需求,所以软件行业除了个人操作系统之外,数 ...

  4. 实用Yii扩展

    可以去官方搜索Yii扩展:Extensions | Yii PHP Framework http://www.yiiframework.com/extensions/?tag=tree Yii che ...

  5. light oj 1297 Largest Box

    1297 - Largest Box   PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB In t ...

  6. 使用AFNetworking 报错提示

    使用AFNetworking 框架 解析数据 报错提示数据请求失败Error Domain=NSCocoaErrorDomain Code=3840 "The operation could ...

  7. Android UI开发第三十四篇——SlidingPaneLayout

    SlidingPaneLayout也是系统支持的高级控件,是Android团对在2013 google IO大会期间更新的Support库(Version 13)中新加入的重要的功能.它支持左右滑动菜 ...

  8. Webdriver:Unsupported Marionette protocol version 2, required 3

    升级到firefox到47以上版本即可 坑人的Mozilla不能起个我们熟识的名字吗? 先是webdriver.gecko.driver后是Marionette protocol.   1.WebDr ...

  9. 清理Win8.1更新冗余的批处理代码

    以下为批处理文件内容,复制到文本文件,另存为.bat文件,以管理员方式运行即可. @echo off title 清理Win8.1更新冗余 color 2e echo 提示:本程序可能需要以管理员方式 ...

  10. IOS 10适配https 包含对于一些http的一些兼容配置

    iOS10 从2017年1月1日起苹果提出所有新提交的App默认不允许使用NSAllowsArbitraryLoads来绕过ATS的限制,也就是说强制我们用HTTPS,如果不这样的话提交App可能会被 ...