tauri_sys::fs

Function write_binary_file

source
pub async fn write_binary_file(
    path: &Path,
    contents: ArrayBuffer,
    dir: BaseDirectory,
) -> Result<(), Error>
Expand description

Writes a byte array content to a file.

ยงExample

use tauri_sys::fs;

fs::write_binary_file(path, contents, BaseDirectory::Download).expect("could not writes binary file");

Requires allowlist > fs > writeBinaryFile to be enabled.