[TC 11.02RC1] Creating a file/directory with invalid characters

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

[TC 11.02RC1] Creating a file/directory with invalid characters

Post by *Fla$her »

HISTORY.TXT wrote:04.10.23 Added: New file (Shift+F4), New Folder (F7), Pack files (Alt+F5): Warn user when file name contains invalid character ?*|:<> and offer to change it to an underscore (32/64)
1. The symbol | is a separator when listing several names, which means that it cannot be replaced with _.
2. When trying to create an object with the names <>, <test> or <test>test nothing happens.
3. If the name starts with <, then adding any invalid character at any stage except \, / or a single > indicates an error and the impossibility of autocorrect ([OK] button is blocked).
4. There is no support for replacing " when creating files or directories.
5. There is no support for replacing \ and / when creating files.
6. It's logical to add the same support for renaming (Shift+F6).
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.02RC1] Creating a file/directory with invalid characters

Post by *ghisler(Author) »

1. Have you actually tried it? | is only replaced when packing, not when using Shift+F4 or F7.
2. Strings beginning with < are special in Shift+F4 and F7 - they are used for ranges, so invalid character checks are disabled.
3. See 2.
4. For directories, surrounding quotes are beging removed. For files, you get a chance to change the name.
5. When you write e.g. test\test.txt and directory test exists, the file will be created within directory "test". However, "test" will not be created if it doesn't exist yet. Currently there are no plans to change this, and I will not replace \ and / for this reason.
6. I will consider it as a suggestion.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: [TC 11.02RC1] Creating a file/directory with invalid characters

Post by *Fla$her »

1. It would be correct for this moment with the packaging dialog to be reflected in the description.
2. I agree, I have already forgotten about the new function for the date and counter.
3. Why is the behavior different then? Maybe use some kind of general warning if < is in front?
4. The quotation mark is an invalid character, it will not necessarily stand on the edges. And why would someone specifically (not for tests) write a quotation mark in these dialogues? A similar rule with autocorrect to _ should also apply to the non-edge quotation mark. For the file now there is only a warning in the dialog itself, this is not the same.
5. Why not offer autocorrect in the absence of a directory or a chain of directories?
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.02RC1] Creating a file/directory with invalid characters

Post by *ghisler(Author) »

4. It's often used to surround names containing spaces, so it can come from a copy and paste operation. You would usually remove them and not replace them with underscores, except maybe when it's in the middle of a name.

I will move this to "will not be changed", sorry.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: [TC 11.02RC1] Creating a file/directory with invalid characters

Post by *Fla$her »

1. You will not correct the description for "|"?
3, 5. I would still like to get a clear answer.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.02RC1] Creating a file/directory with invalid characters

Post by *ghisler(Author) »

1. No, not in the history.
3. when < is in front, the check function is being skipped because placeholders can contain some of the otherwise forbidden characters, e.g. [C:2] for a counter with 2 digits.
5. F7 is meant to create directories, so a chain of them will be created. F4 is not, so the user gets an opportunity to change the name if he meant to create the file in a different subdirectory.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: [TC 11.02RC1] Creating a file/directory with invalid characters

Post by *Fla$her »

3. But how do you explain the difference between <> and <>>? In the first case there are no warnings, in the second there are. And so it is with others.
5. F7 is not discussed here. Only Shift+F4. Why in the case of : is a replacement for _ proposed, and in the absence of the specified folders, the slashes must be edited manually? I consider this inconsistent behavior.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC 11.02RC1] Creating a file/directory with invalid characters

Post by *ghisler(Author) »

3. The function to create a range of files does some checks by itself (this was already in older versions). However, the data between the first <> is not checked in this function because it is used for the range of numbers to be used to create files. It's passed from that dialog to the function which creates the folders. If it contains an invalid range, then no file will be created. For example, the user could write <2-1>[C] which would create no files because the end value is lower than the start value.
5. This is done because : would create a stream, which has lead to a lot of confusion in the past, e.g. when people copied text from somewhere to create a file with the name of that text, and that text contained a colon. For slashes, there is a legitimate usage case (create file in a displayed subdirectory). The user may have made a typo when entering the dir, so it wouldn't make sense to convert it to an underscore.
Author of Total Commander
https://www.ghisler.com
Post Reply