Continuing from the 1.4 planning thread
I'd vote for keeping the menu option.
I agree, given the camera dependent uncertainties, allowing users to go back to the previous behavior is a good thing.
Potential (requested) changes include:
- LFN switch for script use (if it is needed), this only affects the wrapper functions
I think this would be desirable. Script behavior changing depending on user settings makes things more difficult for script authors, and using set_config_value to override user settings risks changing them if the script doesn't end normally.
This leads to the question: should it be an option to os.listdir and os.idir, or should or a separate "set_directory_lfn_mode" function?
My vote is for an option, otherwise modular code would need to get, set and restore it for every call anyway.
In either case, this probably means the underlying opendir should take an option (we could probably use global flags, but this seems a bit hacky even by our standards). I think this is a reasonable way of handling it, but note it will make our opendir nonstandard
http://pubs.opengroup.org/onlinepubs/007908799/xsh/opendir.htmlAnother wrinkle is that the option will have no effect on vxworks, since it already returns LFNs subject to it's own limits/quirks.
- do not return hidden files
I would suggest that script at least should be able to see hidden files. I would lean toward the file browser showing them as well: IMO the point of CHDK is giving you control.
In my testing DryOS R31 and R52 native readdir appear to include hidden files (attr 0x2 set), even in sub directories. Phil earlier said it DryOS didn't return hidden files in sub directories, but this may vary depending on OS, filesystem, or perhaps specifics of the file.
If we add options (presumably a bitmask) to opendir() including/excluding hidden could be another one, but if it only works with the CHDK parser or requires stat-ing each result, I'm not sure it's a good idea.
- do not return long filenames if filename + path longer than ...
This is probably the most important one and it's also complicated: how do we determine the limits? I don't think I've seen any complaints about (for example) metronome.lua being inaccessible on certain cameras. We also can't really expect user feedback.
This is indeed the tricky one. Especially since it depends on some combination of Camera OS and filesystem.
Going back over previous posts, a least common denominator approach would limit total path length to 32, and file name length to 18. This is quite restrictive.