Skip to main content
Module

x/denops_std/function/mod.ts>getfperm

📚 Standard module for denops.vim
Go to Latest
function getfperm
import { getfperm } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts";

The result is a String, which is the read, write, and execute permissions of the given file {fname}. If {fname} does not exist or its directory cannot be read, an empty string is returned. The result is of the form "rwxrwxrwx", where each group of "rwx" flags represent, in turn, the permissions of the owner of the file, the group the file belongs to, and other users. If a user does not have a given permission the flag for this is replaced with the string "-". Examples:

:echo getfperm("/etc/passwd")
:echo getfperm(expand("~/.vimrc"))

This will hopefully (from a security point of view) display the string "rw-r--r--" or even "rw-------".

Can also be used as a method:

GetFilename()->getfperm()

For setting permissions use setfperm().

Parameters

denops: Denops
fname: unknown

Returns

Promise<string>