I would try using "os.rename" to move the existing directory to a new name, then "os.mkdir" to create a new directory using the appropriate name the camera expects to find.
os.rename on a non-empty directory is likely to trash the filesystem. If you go this route, please test carefully on a card without any data that you care about on it, and report back.
Simply renaming the current image directory to a new name works -- no need to create a new directory. This works on A810/1.00e with latest 1.2 build:
d = get_image_dir()
os.rename(d,d..".A")
sleep(5000)
shoot()
d = get_image_dir()
os.rename(d,d..".B")
sleep(5000)
shoot()
The existing image directory
DCIM/113_0112/ contained 2 photos (
IMG_0510 & IMG_0511) and got renamed to
DCIM/113_0112.A/. A new picture is taken which is saved in a new automatically created
DCIM/113_0112/ which then gets renamed to
DCIM/113_0112.B/ and contains
IMG_0512. The last picture is taken and saved in
DCIM/113_0112/The only time I provoked an error using
os.rename was when trying to rename a directory that had just been renamed. In
llibtst.lua, I added the following after the commented
trename line:
tren("A/MDTST0","A/MDTST1")
tren("A/MDTST1","A/MDTST0")
The first tren works but the second one fails and
A/MDTST1 is left on the sdcard.
The cameras do not have a set_image_dir (or SetImageFolder) function that I can find, so the only other way I can think of to get images saved in new directory would be to change camera's clock, which also does not have a direct function, so would need to be done by simulating keypresses.
No filesystems were trashed or otherwise harmed while executing these tests.