feat(io): add read_file/write_file commands and dialog capability

This commit is contained in:
pj committed 2026-06-20 12:54:01 -04:00
1 parent eb63a6d49d
commit 13f2a70af2
3 files changed
+20 -2

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
use std::fs;
#[tauri::command]
pub fn read_file(path: String) -> Result<String, String> {
fs::read_to_string(&path).map_err(|e| e.to_string())
}
#[tauri::command]
pub fn write_file(path: String, contents: String) -> Result<(), String> {
fs::write(&path, contents).map_err(|e| e.to_string())
}