comparison runtime/doc/eval.txt @ 12857:ffdf2e4b5d9a v8.0.1305

patch 8.0.1305: writefile() never calls fsync() commit https://github.com/vim/vim/commit/7567d0b115e332f61a9f390aaccdf7825b891227 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Nov 16 23:04:15 2017 +0100 patch 8.0.1305: writefile() never calls fsync() Problem: Writefile() never calls fsync(). Solution: Follow the 'fsync' option with override to enable or disable.
author Christian Brabandt <cb@256bit.org>
date Thu, 16 Nov 2017 23:15:05 +0100
parents 963cdeb42c41
children 058e93aee621
comparison
equal deleted inserted replaced
12856:4c4a02a946f0 12857:ffdf2e4b5d9a
1 *eval.txt* For Vim version 8.0. Last change: 2017 Oct 28 1 *eval.txt* For Vim version 8.0. Last change: 2017 Nov 16
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
8719 returned. When window {nr} doesn't exist, -1 is returned. 8719 returned. When window {nr} doesn't exist, -1 is returned.
8720 An existing window always has a width of zero or more. 8720 An existing window always has a width of zero or more.
8721 Examples: > 8721 Examples: >
8722 :echo "The current window has " . winwidth(0) . " columns." 8722 :echo "The current window has " . winwidth(0) . " columns."
8723 :if winwidth(0) <= 50 8723 :if winwidth(0) <= 50
8724 : exe "normal 50\<C-W>|" 8724 : 50 wincmd |
8725 :endif 8725 :endif
8726 < For getting the terminal or screen size, see the 'columns' 8726 < For getting the terminal or screen size, see the 'columns'
8727 option. 8727 option.
8728 8728
8729 8729
8760 8760
8761 When {flags} contains "a" then append mode is used, lines are 8761 When {flags} contains "a" then append mode is used, lines are
8762 appended to the file: > 8762 appended to the file: >
8763 :call writefile(["foo"], "event.log", "a") 8763 :call writefile(["foo"], "event.log", "a")
8764 :call writefile(["bar"], "event.log", "a") 8764 :call writefile(["bar"], "event.log", "a")
8765 8765 <
8766 < All NL characters are replaced with a NUL character. 8766 When {flags} contains "s" then fsync() is called after writing
8767 the file. This flushes the file to disk, if possible. This
8768 takes more time but avoids losing the file if the system
8769 crashes.
8770 When {flags} does not contain "S" or "s" then fsync is called
8771 if the 'fsync' option is set.
8772 When {flags} contains "S" then fsync() is not called, even
8773 when 'fsync' is set.
8774
8775 All NL characters are replaced with a NUL character.
8767 Inserting CR characters needs to be done before passing {list} 8776 Inserting CR characters needs to be done before passing {list}
8768 to writefile(). 8777 to writefile().
8769 An existing file is overwritten, if possible. 8778 An existing file is overwritten, if possible.
8770 When the write fails -1 is returned, otherwise 0. There is an 8779 When the write fails -1 is returned, otherwise 0. There is an
8771 error message if the file can't be created or when writing 8780 error message if the file can't be created or when writing