tauri_sys::fs

Function read_binary_file

source
pub async fn read_binary_file(
    path: &Path,
    dir: BaseDirectory,
) -> Result<Vec<u8>, Error>
Expand description

Reads a file as a byte array.

ยงExample

use tauri_sys::fs;

let contents = fs::read_binary_file(filePath, BaseDirectory::Download).expect("could not read file contents");

Requires allowlist > fs > readBinaryFile to be enabled.