glob support for non-Windows platforms?

Started by horshack, April 18, 2021, 05:54:08 PM

Previous topic - Next topic

horshack

I noticed exiftool only enables glob support (filename wildcard expansion) on Windows, even though the code supports it on other platforms and works if I set the $doGlob to 1 in the source. Is there a historical reason it's not enabled for other platforms? It would be useful when processing a large volume of files that would otherwise exceed ARG_MAX. For example, on OSX ARG_MAX is 262144. That seems large but it's only a few thousand files for moderately-sized path names when relying on the shell to do the globbing.

Phil Harvey

ExifTool only does globbing on platforms where the shell doesn't perform this function (ie. Windows).

I think it could be very confusing to do it on other platforms. (eg. How then would you specify a file name containing a "*"?)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

horshack

Quote from: Phil Harvey on April 18, 2021, 08:36:47 PM
ExifTool only does globbing on platforms where the shell doesn't perform this function (ie. Windows).

I think it could be very confusing to do it on other platforms. (eg. How then would you specify a file name containing a "*"?)

- Phil

Thanks Phil. I was thinking the globbing would be optional, like the --include and --exclude options of grep. Or perhaps just an option to toggle globbing on.