Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fs.writeFileSync / SDK 4.2

Hi Everyone,

 

Kindly asking you to help me with the following confusion:

 

1. The idea is for Clockface to query json stored on /mnt/assets/resources/ and show its contents on screen. This part works perfectly

2. Another step would be to actually update certain json object properties as below

Current: [{"hanzi": "\u7231", "pinyin": "\u00e0i", "translations": "to love"}]
Target: [{"hanzi": "\u7231", "pinyin": "\u00e0i", "translations": "to love", "status": "deleted"}]

3. Before diving into that, I thought it would be nice to convert my current json file to cbor so it will be more "optimised" due to better performance so I thought "let's use fs.writeFileSync for that! Next, I'll use that file for further Clockface usage". Unfortunately, I never got to the point of updating cbor since I got confused.

4. fs.writeFileSync saves file to the internal storage which is not accessible through the left directory panel (despite I'm sure it's in the storage, checked via listDirSync loop); moreover, when I extract the fba archive and unarchive it, there is nothing too.

 

In theory, it's fine to work with "hidden" file but it's very inconvenient to not see what's happening within the file during testing. Any ideas re how to overcome this unpleasant situation and write the files that are actually visible for spectator?

 

 

Best Answer
0 Votes
2 REPLIES 2

Files on the watch aren't visible to users.

The FBA only includes files needed to install the product; it does not include files created when it runs. I suspect Studio doesn't display such files either.

If you use the simulator, you can see the simulated version of the on-watch storage. This can be helpful for development.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Thanks, Peter!

 

I definitely able to see the file while running listDirSync loop and even able to display its content, the only trouble is inability to actually open the file and check it, creates additional effort for testing. I hope we can also get some update from Fitbit here, curious if there are any workarounds for that

Best Answer
0 Votes