comparison runtime/doc/eval.txt @ 8451:c0b5c2b0a5ee v7.4.1516

commit https://github.com/vim/vim/commit/8049253b96838b3584600e5ad229abad37a95b10 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 8 17:08:53 2016 +0100 patch 7.4.1516 Problem: Cannot change file permissions. Solution: Add setfperm().
author Christian Brabandt <cb@256bit.org>
date Tue, 08 Mar 2016 17:15:04 +0100
parents 4c6ad81d41fe
children da01d5da2cfa
comparison
equal deleted inserted replaced
8450:198586538c01 8451:c0b5c2b0a5ee
2065 Number send reply string 2065 Number send reply string
2066 serverlist() String get a list of available servers 2066 serverlist() String get a list of available servers
2067 setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val} 2067 setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val}
2068 setcharsearch( {dict}) Dict set character search from {dict} 2068 setcharsearch( {dict}) Dict set character search from {dict}
2069 setcmdpos( {pos}) Number set cursor position in command-line 2069 setcmdpos( {pos}) Number set cursor position in command-line
2070 setfperm( {fname}, {mode}) Number set {fname} file permissions to {mode}
2070 setline( {lnum}, {line}) Number set line {lnum} to {line} 2071 setline( {lnum}, {line}) Number set line {lnum} to {line}
2071 setloclist( {nr}, {list}[, {action}]) 2072 setloclist( {nr}, {list}[, {action}])
2072 Number modify location list using {list} 2073 Number modify location list using {list}
2073 setmatches( {list}) Number restore a list of matches 2074 setmatches( {list}) Number restore a list of matches
2074 setpos( {expr}, {list}) Number set the {expr} position to {list} 2075 setpos( {expr}, {list}) Number set the {expr} position to {list}
3828 :echo getfperm("/etc/passwd") 3829 :echo getfperm("/etc/passwd")
3829 :echo getfperm(expand("~/.vimrc")) 3830 :echo getfperm(expand("~/.vimrc"))
3830 < This will hopefully (from a security point of view) display 3831 < This will hopefully (from a security point of view) display
3831 the string "rw-r--r--" or even "rw-------". 3832 the string "rw-r--r--" or even "rw-------".
3832 3833
3834 For setting permissins use |setfperm()|.
3835
3833 getftime({fname}) *getftime()* 3836 getftime({fname}) *getftime()*
3834 The result is a Number, which is the last modification time of 3837 The result is a Number, which is the last modification time of
3835 the given file {fname}. The value is measured as seconds 3838 the given file {fname}. The value is measured as seconds
3836 since 1st Jan 1970, and may be passed to strftime(). See also 3839 since 1st Jan 1970, and may be passed to strftime(). See also
3837 |localtime()| and |strftime()|. 3840 |localtime()| and |strftime()|.
5998 before inserting the resulting text. 6001 before inserting the resulting text.
5999 When the number is too big the cursor is put at the end of the 6002 When the number is too big the cursor is put at the end of the
6000 line. A number smaller than one has undefined results. 6003 line. A number smaller than one has undefined results.
6001 Returns 0 when successful, 1 when not editing the command 6004 Returns 0 when successful, 1 when not editing the command
6002 line. 6005 line.
6006
6007 setfperm({fname}, {mode}) *setfperm()* *chmod*
6008 Set the file permissions for {fname} to {mode}.
6009 {mode} must be a string with 9 characters. It is of the form
6010 "rwxrwxrwx", where each group of "rwx" flags represent, in
6011 turn, the permissions of the owner of the file, the group the
6012 file belongs to, and other users. A '-' character means the
6013 permission is off, any other character means on. Multi-byte
6014 characters are not supported.
6015
6016 For example "rw-r-----" means read-write for the user,
6017 readable by the group, not accessible by others. "xx-x-----"
6018 would do the same thing.
6019
6020 Returns non-zero for success, zero for failure.
6021
6022 To read permissions see |getfperm()|.
6023
6003 6024
6004 setline({lnum}, {text}) *setline()* 6025 setline({lnum}, {text}) *setline()*
6005 Set line {lnum} of the current buffer to {text}. To insert 6026 Set line {lnum} of the current buffer to {text}. To insert
6006 lines use |append()|. 6027 lines use |append()|.
6007 {lnum} is used like with |getline()|. 6028 {lnum} is used like with |getline()|.