I would like to have your suggestions about writing a Lua script to change the ML config files at will (and restart ML with the chosen configuration).
Let's suppose we have saved in 2 different directories on the CD card, all the ML/SETTINGS files for 2 different situations:
for instance, a standard situation for 1920x1080x24fps and a special one for 3260x1320x12fps .
We created those directories under the ML directory (to keep them when formatting), let's say:
dir1 = ML/MY_DATA/1920 and
dir2 = ML/MY_DATA/3260 .
To start using a new config, let's say, the 3260x1320x12fps one, we only have to replace the files present in the ML/SETTINGS directory with all the ones that we saved in ML/MY_DATA/3260.
It seems obvious when using a computer to read/write files between directories.
But, I would like to do that in the field, without computer.
Many thanks in advance !
Let's suppose we have saved in 2 different directories on the CD card, all the ML/SETTINGS files for 2 different situations:
for instance, a standard situation for 1920x1080x24fps and a special one for 3260x1320x12fps .
We created those directories under the ML directory (to keep them when formatting), let's say:
dir1 = ML/MY_DATA/1920 and
dir2 = ML/MY_DATA/3260 .
To start using a new config, let's say, the 3260x1320x12fps one, we only have to replace the files present in the ML/SETTINGS directory with all the ones that we saved in ML/MY_DATA/3260.
It seems obvious when using a computer to read/write files between directories.
But, I would like to do that in the field, without computer.
Code Select
One answer would be to be able to send, from within a Lua script, commands to the OS like ( in DOS syntax ) :
run "del ML\SETTINGS\*.*"
run "copy ML\MY_DATA\3260\*.* ML\SETTINGS\"
Another answer:
The ML Lua API contains the dryos module with directory:files() and remove( filename) to delete all the files from ML/SETTINGS.
But then, how should we copy the files ?
Many thanks in advance !