Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/function/mod.ts>tempname

๐Ÿ“š Standard module for denops.vim
Go to Latest
function tempname
import { tempname } from "https://deno.land/x/denops_std@v5.0.2/function/mod.ts";

The result is a String, which is the name of a file that doesn't exist. It can be used for a temporary file. The name is different for at least 26 consecutive calls. Example:

:let tmpfile = tempname()
:exe "redir > " .. tmpfile

For Unix, the file will be in a private directory tempfile. For MS-Windows forward slashes are used when the 'shellslash' option is set, or when 'shellcmdflag' starts with '-' and 'shell' does not contain powershell or pwsh.

Returns

Promise<string>