(Storage File) ? How to upload them through IDE

Posted on
  • I mistakenly logged 2 walks in the same GPS log file. So I downloaded the file and split them. However when I upload the file I end up with quotes round the filename. How could I upload these files ? Also I am wondering what is the purpose / benefit of having these files have (Storage File) appended on the end of the filename ?


    1 Attachment

    • Screenshot 2021-03-21 18.08.47.png
  • here's how the file looked after I uploaded it.


    1 Attachment

    • Screenshot 2021-03-21 18.09.01.png
  • The issue is that xyz (StorageFile) isn't actually the filename, it's just a note to say it's a different kind of file - see http://www.espruino.com/Reference#Storag­eFile

    I think right now there's actually no way to upload a file as a StorageFile using the IDE. About all you could do is upload to a normal file, and then use some code on Espruino to copy the standard File to a StorageFile.

    I'm not 100% sure but this may be all you need:

    s = require("Storage");
    s.open(".gpsrc3", "w").write(s.read("myuploadedfile"));
    

    If the plan is to just be able to export the GPS data though then @Serj actually make an exporter that works outside of Bangle.js: http://forum.espruino.com/conversations/­360747/#15864867

  • I am wondering what is the purpose / benefit of having these files have (Storage File) appended on the end of the filename

    There are two ways/APIs how to write to storage - Storage.write/read see https://www.espruino.com/Reference#Stora­ge or StorageFile https://www.espruino.com/Reference#Stora­geFile So it is a marker to know which type it is. I guess removing it from name would break it in a way that it will be written in a 'wrong' way via the Storage.write and then won't be found by code expecting to open it via Storage.open

    EDIT: oh gordon already explained it so ignore this

  • thanks both.

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

(Storage File) ? How to upload them through IDE

Posted by Avatar for HughB @HughB

Actions