ghisler(Author) wrote: 2026-04-30, 06:45 UTC
Now instead I check whether there is at least one double quote, and if yes, I replace all spaces which are NOT inside a double quote with vertical lines. Example:
"name 1" name2 name3 "name 4" -> "name 1"|name2||name3|"name 4"
Empty names are ignored.
Except that trailing spaces at the end of the entire input string are removed, which creates inconsistencies.
These are considered equal (leading space in first line) :
But these are not (trailing space in first line):
In the latter example, the input with a trailing space gets the space removed, resulting in a single quoted filename. And a single quoted filename fails in this dialog (which is also counterintuitive for the user).
Another inconsistency is that trailing spaces do not get removed when using cm_Edit /GCN or cm_Edit /N. Example:
This is considered a list of filenames and works. But leave out the G and it doesn't work.
The treatment of separator spaces at the very beginning and at very end may not be intuitive for the user.
I think it is intuitive for the user that using a "|" is explicitly specifying a list of filenames. Example:
I think it is intuitive that this is interpreted as that the user explicitly specified a list of names (with one empty name).
But I think it is different when spaces are separators. Example (quoted name with leading and trailing spaces):
Most people would probably see this as 1 filename and not as an explicitly specified list of filenames.
ghisler(Author) wrote: 2026-04-30, 06:45 UTC
What you can't use is a mix of spaces and vertical lines, e.g.
name1 | name2
Here TC will try to create name1 with a trailing space (which windows will not do) and name2 with a leading space (which works).
I think this is not entirely correct. Trailing spaces are accepted, but not created as part of the filename when using the regular namespace. But trailing spaces are created in the filename when using the namespace \\?\ (for example, execute "cd \\?\d:\test\" first before trying to create the files).
(To delete filenames with trailing spaces, use the regular namespace)
But it is a bad example, because the thread is about when using quoted filenames. So the example should be:
I think it is a matter of choice whether or not spaces should be interpreted as separators as well in this case. Currently that doesn't seem to be the case and the result is that the second name is (silently) not created. The first name is created and has a trailing space when working in the \\?\ namespace.