Skip to content

how reading a file? #7323

Closed Answered by FabianLars
NyshimoriMizuki asked this question in Q&A
Jun 29, 2023 · 1 comments · 7 replies
Discussion options

You must be logged in to vote

okay, so i think i misunderstood the problem then. i though the data dir is actually at the root of your filesystem. In this case you probably only need to remove the leading / in resolveResource to make it work.
In general, resolveResource expects path similar to how you specified them in the resources property in tauri.conf.json, a few examples:

      "resources": [
        "/absolute/path/to/textfile.txt", // on windows this would start with the drive letter of course
        "relative/path/to/jsonfile.json", // relative to tauri.conf
        "../relative/in/parent/dir/file.toml" // relative to tauri.conf
      ]
// To get the paths to each of them:
await resolveResource("/absolute/pat…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@NyshimoriMizuki
Comment options

@FabianLars
Comment options

@NyshimoriMizuki
Comment options

@FabianLars
Comment options

Answer selected by NyshimoriMizuki
@m4heshd
Comment options

@FabianLars
Comment options

@m4heshd
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants