File Manager for PicoMite


Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5056
Posted: 04:59pm 13 Apr 2025      

  Mixtel90 said  The Library is, in fact, really simple. The only weird thing about it is that LIBRARY SAVE should really be called LIBRARY MOVE because it moves the code from program space to the Library then does a NEW, there is no copy of it left in the program area.

Typically you would run something like "fm", which would call "SUB fm" in the Library. I suppose this could be fm "A" or fm "B" to select the initial drive.
The rest of the Library routines are ordinary SUB and FUNCTION routines as you'd expect. The beauty of the Library system is that all the routines stored there can be run from a user program, so an input routine, for example, even though it would be intended for SUB fm could be used anywhere.

I've also run TassyJim's file manager from drive A. That worked out ok. I hate losing another flash slot - I can't see any reason to do so unless it's only during development.


Hi Mick,

Including a program into the library, something as large as the filemanager, may not be a good thing. Note that the filemanager then is part of your user program. All the memory it reserves (for all the filenames) become part of your programs heap. And to handle large (SD card) file systems, they reserve quite a lot of heap (59k of 100k on a VGA unit with twofingers KLINGON version of the filemanager).




The result will be that your user program can only be small (cannot use large arrays or lots of strings). Maybe sufficient for your fish tank controller, but that is it. And since it is in the library, that accounts for ALL program you want to run on that pico.

When it is in a flash slot, it is -either-or-. So it is a separate program, and yes, it uses a lot of heap, but when you close the fm, and start your own program all heap is yours.

I think it is wise to keep it in a flash slot.

Volhout
Edited 2025-04-14 03:15 by Volhout