Function tauri_sys::fs::read_text_file

source ·
pub async fn read_text_file(
    path: &Path,
    dir: BaseDirectory,
) -> Result<String, Error>
Expand description

Read a file as an UTF-8 encoded string.

§Example

use tauri_sys::fs;

let contents = fs::readTextFile(path, BaseDirectory::Download).expect("could not read file as text");

Requires allowlist > fs > readTextFile to be enabled.