open
open(
path
,options?
):Promise
<FileHandle
>
Defined in: plugins/fs/guest-js/index.ts:565
Open a file and resolve to an instance of FileHandle
. The
file does not need to previously exist if using the create
or createNew
open options. It is the callers responsibility to close the file when finished
with it.
string
| URL
Promise
<FileHandle
>
import { open, BaseDirectory } from "@tauri-apps/plugin-fs"const file = await open("foo/bar.txt", { read: true, write: true, baseDir: BaseDirectory.AppLocalData });// Do work with fileawait file.close();
2.0.0
© 2025 Tauri Contributors. CC-BY / MIT