Skip to main content
Latest
function fn.filereadable
import { fn } from "https://deno.land/x/denops_lsputil@v0.9.4/deps.ts";
const { filereadable } = fn;

The result is a Number, which is TRUE when a file with the name {file} exists, and can be read. If {file} doesn't exist, or is a directory, the result is FALSE. {file} is any expression, which is used as a String. If you don't care about the file being readable you can use glob(). {file} is used as-is, you may want to expand wildcards first:

echo filereadable('~/.vimrc')
0
echo filereadable(expand('~/.vimrc'))
1

Can also be used as a method:

GetName()->filereadable()

Obsolete name: file_readable().

Parameters

denops: Denops
file: unknown

Returns

Promise<number>