create
create(
path,options?):Promise<FileHandle>
Defined in: plugins/fs/guest-js/index.ts:480
Creates a file if none exists or truncates an existing file and resolves to
an instance of FileHandle.
string | URL
Promise<FileHandle>
import { create, BaseDirectory } from "@tauri-apps/plugin-fs"const file = await create("foo/bar.txt", { baseDir: BaseDirectory.AppConfig });await file.write(new TextEncoder().encode("Hello world"));await file.close();2.0.0
© 2025 Tauri Contributors. CC-BY / MIT