So, in the File System Guide it says to do this to list all files in /private/data directory:
import { listDirSync } from "fs";
const listDir = listDirSync("/private/data");
while((dirIter = listDir.next()) && !dirIter.done) {
console.log(dirIter.value);
}When I run this on Versa 3 watch connected to the Fitbit Studio it gives this error:
**
Unhandled exception: ReferenceError: dirIter is not defined
**
By the way I have tried this when I have multiple files in the /private/data directory and it still does not work.
What is the problem? I appreciate your help.
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.
Thanks, will make a note to fix this example
Best AnswerHi @JonFitbit , I was facing the same issue today following this guide https://dev.fitbit.com/build/guides/file-system/