summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-11-16 23:04:15 +0100
committerBram Moolenaar <Bram@vim.org>2017-11-16 23:04:15 +0100
commit7567d0b115e332f61a9f390aaccdf7825b891227 (patch)
treee4ab87bf66391ca7243d819c768dc907cdd411da /runtime
parentd0480097177369a6ed91d47aba189ae647afcd68 (diff)
patch 8.0.1305: writefile() never calls fsync()v8.0.1305
Problem: Writefile() never calls fsync(). Solution: Follow the 'fsync' option with override to enable or disable.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt17
1 files changed, 13 insertions, 4 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index f754892caa..c001f6f2b7 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 8.0. Last change: 2017 Oct 28
+*eval.txt* For Vim version 8.0. Last change: 2017 Nov 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -8721,7 +8721,7 @@ winwidth({nr}) *winwidth()*
Examples: >
:echo "The current window has " . winwidth(0) . " columns."
:if winwidth(0) <= 50
- : exe "normal 50\<C-W>|"
+ : 50 wincmd |
:endif
< For getting the terminal or screen size, see the 'columns'
option.
@@ -8762,8 +8762,17 @@ writefile({list}, {fname} [, {flags}])
appended to the file: >
:call writefile(["foo"], "event.log", "a")
:call writefile(["bar"], "event.log", "a")
-
-< All NL characters are replaced with a NUL character.
+<
+ When {flags} contains "s" then fsync() is called after writing
+ the file. This flushes the file to disk, if possible. This
+ takes more time but avoids losing the file if the system
+ crashes.
+ When {flags} does not contain "S" or "s" then fsync is called
+ if the 'fsync' option is set.
+ When {flags} contains "S" then fsync() is not called, even
+ when 'fsync' is set.
+
+ All NL characters are replaced with a NUL character.
Inserting CR characters needs to be done before passing {list}
to writefile().
An existing file is overwritten, if possible.