Deleting multiple files at once in storage

Posted on
  • Hey everyone,

    I wonder if there is a convenient way to delete multiple files from the Bangle's storage at once.
    For example: When I want to delete a bunch of ActivePedometer data files, is there a better way than deleting every single file via the IDE or the FileManager app?

  • In require("Storage").list you can supply a regular expression

    So you can enter some code like: require("Storage").list(/^activepedom/).­forEach(require("Storage").erase)

    I'd recommend you enter just require("Storage").list(/^activepedom/) first so you can see a list of the files that are going to be deleted though ;)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Deleting multiple files at once in storage

Posted by Avatar for radswid @radswid

Actions