How to safely get multiple filenames from Zenity

filenameszenity

Zenity can be used to create a file selection dialog and select multiple paths. The separator for paths is specified using the --separator option. Therefore we can't use NUL, the only safe character for delimiting filenames. So, aside from multiple file selection dialogs, is there any way to safely get multiple paths from Zenity? Or using another dialog program?

Best Answer

You could use another character that cannot appear in a file name: /
so once you got your list of files you know that paths are separated by two slashes: // (the second being part of the path as each path starts with a slash but doesn't end with one). You could then use your favourite tool to turn the list into NUL separated paths...

Related Question