But those are scripts that are injected into ExecuteScript for every file.
So?
Would it be possible to upload the files first and then generate Lua code to update all the timestamps in a single call?
Sure. You'd probably want to batch them to avoid potentially running out of memory on large numbers of files.
mupload could be optimized a bit just by combining the various stat and mkdir calls for each file. There's even a
TODO for it
![Wink ;)](https://chdk.setepontos.com/Smileys/smile/wink.gif)
But really, script execution overhead is fairly small.
Will UploadFile create a target directory if it doesn't exist?
No. It literally just does open / write / close.
I'd need a more specific argument before I consider adding something to the PTP protocol.
I suppose if it were possible to do something like
load_module("unzip", "CHDK.zip")
in script, there would be no need for extending the PTP protocol. However, I strongly suspect that adding something like that to Lua would be much harder.
OK, I was confused. I thought the functionality you were referring to was getting the list of menu IDs for your user menu editor.
I definitely do not see the point of adding CHDK PTP protocol to load a modules that unzips a file. The existing upload system works fine, there's no reason to add complexity to the protocol or core for this.
I think your example would actually be relatively easy to add, and would have applications beyond PTP. You'd have a class of modules that effectively act like a command line programs: i.e. invoke once with simple string parameters, block Lua until it's done, return values in some simple format. This could be used for unzipping, hashing, and who knows what else.
I'm not saying you should run off and implement it, but it's definitely the kind of building block approach I prefer.
I believe the other cameras use the same driver.
chdkptp is built with libusb-win32. If winusb somehow supports this, I don't know anything about it.