Hi, I'm pretty new to CHDK. I was hoping to make a script to delete all raw files except for ones where a corresponding jpeg exists.
FWIW, the "raw purge" function in the menu should do this. You could probably invoke by sending button presses from script.
There has been one report of this it corrupting the cards filesystem. AFAIK it hasn't been confirmed/reproduced, but you might want to test first on a card that you wouldn't mind having to re-format.
It looks like I should be able to do this from LUA, but i have no experience in this language. I'm experienced in other languages and I'm a fast learner, so I was hoping someone could give me a hand starting off?
The lua documentation is quite quite good:
Lua 5.1 Reference Manual - contentsFor a more tutorial introduction, there's roberto's book
Programming in Lua : contents The edition available online is for Lua 5.0, but most of the language is the same. You can also find tutorials at
Lua: documentationCHDK specific features and differences are mostly documented on the CHDK wiki
LUA - CHDK WikiThere are also some examples floating around. The test script I wrote for the io and os functions shows how all of them can be used.
I had also found a script that deletes the lowest numbered Raw file, but I don't remember where I found it, and i could not find it when I looked for it again. If anyone knows what I'm talking about could you point me back to that post?
You might be thinking of this
Deleting images with interval shooting although it isn't exactly what you want.
Note that I've added the ability to stat files since that script was written, so you could go by date instead of number. However, I haven't added directory listing functions, so you'll still have to iterate through the numbers you want to check. This is on my list, I just haven't done it yet.