(TECH) storing files in RAM-disk from custom VXP sketches?

Hi there!
I’d like to temporary save some files in application runtime on a RAM-disk or something like so, to don’t decrease write cycles on internal RePhone’s flash.
But I can’t find anything related in RePhone documentation. Can you advice me, how can I achieve that?

Malloc/calloc() and copy file data to that area? Or you want to use/edit too or just store?

Ideally — that one you’re calling “use/edit” :wink:
I thought about infinite loop of:

  1. recording few seconds of sound (through a mic in audio module) in a file on RAM disk
  2. play it through speaker
    (or even simultaneous “record+send via tcp” and “receive via tcp+play”)

And, actually, I thought to do that through Lua API (which anyway missing a function to record sound ATM), because I doing that as exercise to teach kids for programming :wink:

That sounds like a stream, so technically if you can address some RAM area with the play() function, then it’s considered done.
The sad thing that the api supports only recording to a file. More sad that it CAN handle multiple disks, but I can’t find any clue that it can reference a memory address as a disk. It has getters for disk info, but no setter. Also the info struct does not provide an address, so direct hacking of a logical disk info won’t make any difference. Probably it needs to be set in some startup code. And after that you still have to make a file system on that virtual disk. You like to play hard :wink: