I use the Tauri JS on Ubuntu. I would like to read a csv file which is in the project directory.
/data/example.csv
/src-tauri/
/src
...
I activated the fs
module, I tried different patterns
"all": true,
"fs": {
"scope": {
"allow": ["$APP/**", "$APP/db/**", "$APP/data/**" ,"$DOWNLOAD/**", "$RESOURCE/**", "/data/**", "data/**"]
}
},
But when I try to read with the following code:
import { readTextFile } from "@tauri-apps/api/fs";
let filePath = "./data/example.csv";
console.log("File path:", filePath)
const promise = readTextFile(filePath);
promise.then((response) => {
console.log(response);
}).catch((error) => {
console.error(error);
})
I always get the following error:
[Error] path not allowed on the configured scope: ./data/profiles.csv