Error message when using forbidden characters in filenames
Moderators: white, Hacker, petermad, Stefan2
Error message when using forbidden characters in filenames
Hello,
When a user want to rename a file and try to use characters not allowed in file names (like : / \ etc.), Total Commander returns the following error message:
Error: Cannot write <filename>!
Please remove the write protection!
I suggest to replace this error by more suitable message in this situation like Windows Explorer do it:
"A file name can't contain any of the following characters: \ /..."
Also I suggest to change Total Commander behavior to Windows Explorer: prevent inserting illegal characters instead of error message pop-up.
There are cases when a user has inputted a long filename with one illegal character. Total Commander displays the error and clear all text in the filename, and the user need to type all characters in the filename again.
I have described only one case (file rename). But there are many other cases.
For example, create a new directory. Total Commander displays the error:
Directory <name> not created!
OK___________As Administrator
But Administrator also can't use forbidden characters in directory names
Related posts:
https://www.ghisler.ch/board/viewtopic.php?t=47124
https://www.ghisler.ch/board/viewtopic.php?t=38733
https://www.ghisler.ch/board/viewtopic.php?p=121725
When a user want to rename a file and try to use characters not allowed in file names (like : / \ etc.), Total Commander returns the following error message:
Error: Cannot write <filename>!
Please remove the write protection!
I suggest to replace this error by more suitable message in this situation like Windows Explorer do it:
"A file name can't contain any of the following characters: \ /..."
Also I suggest to change Total Commander behavior to Windows Explorer: prevent inserting illegal characters instead of error message pop-up.
There are cases when a user has inputted a long filename with one illegal character. Total Commander displays the error and clear all text in the filename, and the user need to type all characters in the filename again.
I have described only one case (file rename). But there are many other cases.
For example, create a new directory. Total Commander displays the error:
Directory <name> not created!
OK___________As Administrator
But Administrator also can't use forbidden characters in directory names
Related posts:
https://www.ghisler.ch/board/viewtopic.php?t=47124
https://www.ghisler.ch/board/viewtopic.php?t=38733
https://www.ghisler.ch/board/viewtopic.php?p=121725
- ghisler(Author)
- Site Admin
- Posts: 48108
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Not confirmed. If I change a file name from e.g. test.txt to te\st.txt, TC creates folder "te" and moves the file inside name "st.txt". You get access denied if TC cannot create the folder.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Please try to change a file name from test.txt to te:st.txt or te"st.txt or te<st.txt or te>st.txt or te|st.txtghisler(Author) wrote:Not confirmed. If I change a file name from e.g. test.txt to te\st.txt, TC creates folder "te" and moves the file inside name "st.txt". You get access denied if TC cannot create the folder.
BTW, when I change test.txt to te?st.txt, TC renames the file to tesst.txt
About using backslash in file names: this is a nice feature if I need to create a folder tree. I suggest to describe it in the Help file.
- ghisler(Author)
- Site Admin
- Posts: 48108
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Ah, yes, you are right for te"st.txt and others. The problem is that I just get an access denied error from Windows, but not the reason of it.
The ? and * are wildcards - ? stands for a single character, * for multiple characters.
The ? and * are wildcards - ? stands for a single character, * for multiple characters.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
-
- New Member
- Posts: 0
- Joined: 2020-04-17, 09:25 UTC
Re:
this is also something that I think should be featured in the TC.
https://devblogs.microsoft.com/oldnewthing/20110110-00/?p=11793
- ghisler(Author)
- Site Admin
- Posts: 48108
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Error message when using forbidden characters in filenames
That's indeed a nice feature. But how do I determine the forbidden characters for a specific file system? For example, Apple devices and Linux PCs allow more characters than Windows.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Error message when using forbidden characters in filenames
2tiberius_net,
2ghisler(Author)
At first glance, it sounds like a good idea. However, there is one flaw when removing forbidden characters completely from a filename. What if the user wants or needs to replace (certain) forbidden characters with another character like space or underscore, or any other valid character, maybe even on a case-by-case basis? If TC filters them out, there's no way of knowing where the forbidden characters were once the name is pasted (and forbidden characters stripped). If TC would provide an interactive way to set the replacement character(s), or maybe disabling the stripping of invalid characters, it would be OK.
Regards
Dalai
2ghisler(Author)
At first glance, it sounds like a good idea. However, there is one flaw when removing forbidden characters completely from a filename. What if the user wants or needs to replace (certain) forbidden characters with another character like space or underscore, or any other valid character, maybe even on a case-by-case basis? If TC filters them out, there's no way of knowing where the forbidden characters were once the name is pasted (and forbidden characters stripped). If TC would provide an interactive way to set the replacement character(s), or maybe disabling the stripping of invalid characters, it would be OK.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: Error message when using forbidden characters in filenames
I think the only good solution is to use substitution table.
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator