Error message when using forbidden characters in filenames

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

Moderators: sheep, Hacker, Stefan2, white

Post Reply
misvin
Junior Member
Junior Member
Posts: 72
Joined: 2010-08-14, 11:25 UTC

Error message when using forbidden characters in filenames

Post by *misvin » 2017-11-11, 11:07 UTC

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 :D

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

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38395
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-11-12, 14:47 UTC

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
http://www.ghisler.com

misvin
Junior Member
Junior Member
Posts: 72
Joined: 2010-08-14, 11:25 UTC

Post by *misvin » 2017-11-12, 16:03 UTC

ghisler(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.
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.txt

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.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38395
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-11-13, 15:06 UTC

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.
Author of Total Commander
http://www.ghisler.com

misvin
Junior Member
Junior Member
Posts: 72
Joined: 2010-08-14, 11:25 UTC

Post by *misvin » 2017-11-13, 15:26 UTC

ghisler(Author) wrote:The problem is that I just get an access denied error from Windows, but not the reason of it.
Can you prevent inserting illegal characters in the "real time" mode when a user inputs a file/directory name (like Windows Explorer behavior)?

Post Reply