Raw Deletion - Script Writing - CHDK Forum

Raw Deletion

  • 1 Replies
  • 2999 Views
Raw Deletion
« on: 25 / October / 2008, 18:38:09 »
Advertisements
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. 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?

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?

*

Offline reyalp

  • ******
  • 14125
Re: Raw Deletion
« Reply #1 on: 25 / October / 2008, 19:01:04 »
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.
Quote
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 - contents

For 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: documentation

CHDK specific features and differences are mostly documented on the CHDK wiki
LUA - CHDK Wiki

There 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.
Quote
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.
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal