diff runtime/doc/eval.txt @ 14599:72d6f6f7ead7 v8.1.0313

patch 8.1.0313: information about a swap file is unavailable commit https://github.com/vim/vim/commit/00f123a56585363cd13f062fd3bb123efcfaa664 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 21 20:28:54 2018 +0200 patch 8.1.0313: information about a swap file is unavailable Problem: Information about a swap file is unavailable. Solution: Add swapinfo(). (Enzo Ferber)
author Christian Brabandt <cb@256bit.org>
date Tue, 21 Aug 2018 20:30:05 +0200
parents d33220d3bc27
children d0ff19a55579
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2409,6 +2409,7 @@ submatch({nr} [, {list}])	String or List
 					specific match in ":s" or substitute()
 substitute({expr}, {pat}, {sub}, {flags})
 				String	all {pat} in {expr} replaced with {sub}
+swapinfo({fname})		Dict	information about swap file {fname}
 synID({lnum}, {col}, {trans})	Number	syntax ID at {lnum} and {col}
 synIDattr({synID}, {what} [, {mode}])
 				String	attribute {what} of syntax ID {synID}
@@ -8001,6 +8002,22 @@ substitute({expr}, {pat}, {sub}, {flags}
 		|submatch()| returns.  Example: >
 		   :echo substitute(s, '%\(\x\x\)', {m -> '0x' . m[1]}, 'g')
 
+swapinfo({fname})					swapinfo()
+		The result is a dictionary, which holds information about the
+		swapfile {fname}. The available fields are:
+			version VIM version
+			user	user name
+			host	host name
+			fname	original file name
+			pid	PID of the VIM process that created the swap
+				file
+			mtime	last modification time in seconds
+			inode	Optional: INODE number of the file
+		In case of failure an "error" item is added with the reason:
+			Cannot open file: file not found or in accessible
+			Cannot read file: cannot read first block
+			magic number mismatch: info in first block is invalid
+
 synID({lnum}, {col}, {trans})				*synID()*
 		The result is a Number, which is the syntax ID at the position
 		{lnum} and {col} in the current window.