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”
I thought about infinite loop of:
- recording few seconds of sound (through a mic in audio module) in a file on RAM disk
- 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
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