diff options
author | Lukas Larsson <[email protected]> | 2013-11-29 10:46:36 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2013-11-29 10:46:36 +0100 |
commit | 670150ff9bfdce856c327fb76c30e58039df2cba (patch) | |
tree | 575e29d27c2dca7039f5dee0f87d4fc15f2c574f /lib/kernel/doc/src/file.xml | |
parent | 423d37395076528866c4b689c0f1e9b72dae58e1 (diff) | |
parent | f47c818746c1df4055b1de8aabf47364f502274c (diff) | |
download | otp-670150ff9bfdce856c327fb76c30e58039df2cba.tar.gz otp-670150ff9bfdce856c327fb76c30e58039df2cba.tar.bz2 otp-670150ff9bfdce856c327fb76c30e58039df2cba.zip |
Merge branch 'sv/file-osync/OTP-11498'
* sv/file-osync/OTP-11498:
Add sync option to file:open/2
Conflicts:
erts/preloaded/ebin/prim_file.beam
Diffstat (limited to 'lib/kernel/doc/src/file.xml')
-rw-r--r-- | lib/kernel/doc/src/file.xml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml index 1118a8feee..0a4dd3ba47 100644 --- a/lib/kernel/doc/src/file.xml +++ b/lib/kernel/doc/src/file.xml @@ -826,6 +826,16 @@ <item> <p><c>File</c> must be <c>iodata()</c>. Returns an <c>fd()</c> which lets the <c>file</c> module operate on the data in-memory as if it is a file.</p> </item> + <tag><c>sync</c></tag> + <item> + <p>On platforms that support it, enables the POSIX <c>O_SYNC</c> synchronous I/O flag or its platform-dependent + equivalent (e.g., <c>FILE_FLAG_WRITE_THROUGH</c> on Windows) so that writes to the file block until the data has + been physically written to disk. Be aware, though, that the exact semantics of this flag differ from platform to + platform; for example, neither Linux nor Windows guarantees that all file metadata are also written before the call + returns. For precise semantics, check the details of your platform's documentation. On platforms with no + support for POSIX <c>O_SYNC</c> or equivalent, use of the <c>sync</c> flag causes <c>open</c> to return + <c>{error, enotsup}</c>.</p> + </item> </taglist> <p>Returns:</p> <taglist> |