• I'll update the reference, but as @fanoush says, StorageFile is built on top of the standard storage functionality, which makes it harder to separate the two.

    Normal Storage functions are what I'd recommend you use for basically everything unless you intend to append textual data (eg a log file). They're much more efficient to write and read.

    StorageFile exists because on Bangle.js especially there's a need to log data (GPS readings, heart rate, etc) and using fixed-size files for that is a complete pain.

    Maybe there should be Storage.list and StorageFile.list?

    The issue is StorageFile is really only something you create with require("Storage").open. So probably it's going to end up being require("Storage").listSF or require("Storage").list({storageFile:tru­e})

  • Thanks for the extensive explanation, sounds like a perfect addition for the reference. It's clear for me now.

    Coming from other languages it feels "natural" to start with an "open" command, so that's the reason why I chose Storagefile in the 1st place.

    This says it all!

    Normal Storage functions are what I'd recommend you use for basically everything unless you intend to append textual data (eg a log file). They're much more efficient to write and read.

About

Avatar for gerardwr @gerardwr started