I'm trying to read some binary data. I've added a file called "level_data.bin" to the resources folder but I can't open it for reading.
import * as fs from "fs";
let file = fs.openSync("../resources/level_data.bin", "r");
I've tried it with / and \ and no path at all, thinking it might automatically look in the resources folder. I've also tried the file in the app folder (so there's no relative path), but it just can't open it.
Answered! Go to the Best Answer.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
Hey Allan!
Can you try: /mnt/assets/resources/
Let me know how you get on!
Are you certain the file is being copied to the app?
You can download the packaged app (option on the top toolbar inside Studio) and unpack it to see if the file is indeed being packed or not. I'm not certain of how they have rollup configured, so you might have to figure out a clever hack for getting it bundled if not. (Just a hunch)
Best AnswerI've checked the package and the file is definitely there, and definitely in the resources folder.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.