-
I have a folder called blocks in my tauri project, I'm using rust to access files in this directory
that function in my main.rs #[tauri::command]
fn get_blocks() -> String {
let blocks_dir_path: PathBuf = PathBuf::from("./../blocks");
let paths: ReadDir = match fs::read_dir(&blocks_dir_path) {
Ok(paths) => paths,
Err(err) => {
eprintln!("Failed to open blocks directory: {}", err);
return String::from("[]");
}
};
//...
} This function works fine in yarn tauri dev I figured it out that, the problem here is path. The path I used is not available on build and I don't know how can i solve this. |
Beta Was this translation helpful? Give feedback.
Answered by
abkarim
Apr 20, 2023
Replies: 1 comment
-
I got help from discord community of tauri Actually That folder doesn't exist. And I had to add it manually |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
FabianLars
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got help from discord community of tauri
Actually That folder doesn't exist. And I had to add it manually
https://tauri.app/v1/api/js/path/#resourcedir