Observation: L6 infinite while()
Do I need to say more?
L8 is most likely queued up multiple times before the first write occurs and is allowed to finish, cleaning up file I/O overhead. Maybe try a callback strategy, rather than relying on an error detection scheme?
This is as expected - it's as I'd mentioned in a previous thread - pages are ~4k, you have 255 pages because that's all you get with 1 char, so that's 1MB.
You can now have 4 separate 1MB files, but the max file size for one StorageFile is 4MB.
You can also allocate a massive (3.5MB maybe?) file using just
Storage.writeand then write to it yourself with your own method of figuring out where in the file you are.
Ah... silly me. I took long (ish) file names an indication of more than 255 pages being possible.
I quite like the
StorageFileapi so I think I'll just build a rudimentary roll-over system where a new file is created on reaching max-size, until I've run out of all space available. Still hoping to never use all that space :-).
If I run this code on a cleaned up Bangle watch, it seems to throw a
file too big erroreventually and the file size reported is ~ 1Mb. Am I doing something wrong to not be able to write on beyond 1Mb ?
(** BEWARE: starts with Storage.eraseAll() ** )
Following are my env details
My fork was last synced with upstream on March 1, so I am wee bit behind. Apologies if this is causing the issue.
Update: Just to clarify, I was expecting the File write to error out after ~4Mb which is the max capacity of the BangleJS.