Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/xdg/vendor/types/deno.d.ts>Deno.close

Determine XDG Base Directory paths (OS/platform portable)
Go to Latest
function Deno.close
import { Deno } from "https://deno.land/x/xdg@v10.3.0/vendor/types/deno.d.ts";
const { close } = Deno;

Close the given resource ID (rid) which has been previously opened, such as via opening or creating a file. Closing a file when you are finished with it is important to avoid leaking resources.

const file = await Deno.open("my_file.txt");
// do work with "file" object
Deno.close(file.rid);

Parameters

rid: number