Wrong message when creating directory

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

User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Wrong message when creating directory

Post by *DrShark »

When you'll try to create dir with ? sign in name, you'll get the following valid message:
Error: Directory [dirname?] not created ; OK and admin rights buttons.
But in the name is only ?, TC shows next:
---------------------------
Total Commander
---------------------------
Error: Directory [?]
already exists!
Please specify a different name.
---------------------------
ОК
---------------------------
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

WinxP Pro SP2, TC7rc4:

Using <F7>, tried to create a folder named Unguel?tig.
Changed the position of the question mark inside the string several times, does not make any difference.

T.C. always told me:
Error: Directory [Unguel?tig]
could not be created!

[OK] [As Admininistrator]
So the messagebox looks a bit different for me. But the issue remains the same:
TC might realize I try to insert a character which cannot be used inside filenames and foldernames, because it is a reserved character. And it might tell me so.

Karl
Last edited by karlchen on 2007-05-09, 09:39 UTC, edited 1 time in total.
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

Difference when:
But in the name is only ?
Sorry, I should write if, not in...
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Ok, I see. Hm, really? :?

Once I confirm the first error message by clicking on [OK], I do not get any second error message at all.

No folder is created - of course not, name was invalid - nothing happens.
---
Once I confirm the first error message by clicking on [As Administrator], I will have to logon using a valid admin account.

Next I will get the first error message again.

I.e. I never see
---------------------------
Total Commander
---------------------------
Error: Directory [?]
already exists!
Please specify a different name.
---------------------------
ОК
---------------------------
Really, I do not.
WinXP Pro SP2, TC7rc4.

OK, I guess you entered as a foldername "?" only, unlike me who entered a string holding ? at a random position.

Karl
Last edited by karlchen on 2007-05-09, 09:48 UTC, edited 2 times in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

? is a special placeholder which means "any character". If TC checks whether a folder with this name already exists, Windows tells "yes", because of the updir "." folder. Unfortunately there is no feasible way to avoid this error, sorry.
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

Why you cannot show your own error megssage instead of Windows's?
I think the message "Directory [?] already exists!" should be shown only if I try to create dir alike "..\?"
Last edited by DrShark on 2007-05-09, 09:54 UTC, edited 1 time in total.
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

ghisler(Author) wrote:Unfortunately there is no feasible way to avoid this error, sorry.
Why not just check if the name entered by the user contains '?' or '*' and in this specific case show another error message? (For example, the same "Directory [...] could not be created!", so that there was no need to add new translations.)
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

The basic question behind the issue reported by DrShark is:

Should T.C. check a given foldername for all possibly illegal characters - the list may differ between OS versions?! - or depend on the OS to make sure no illegal characters will be accepted?

If TC does not check for illegal characters, it cannot issue an error message about them. It will therefore stumble upon and complain about the next subsequent error .

This is why DrShark gets a different error message trying to create folder "?" than me trying to create "unguel?tig". And this is, too, why both error messages do not give a hint what is the problem with our suggested foldernames.

Karl
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

Addition:
If try to create folder named " TC also will show msg about existing folder.
The same for | sign. In this case msgbox shown twice!
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
? is a special placeholder which means "any character". If TC checks whether a folder with this name already exists, Windows tells "yes", because of the updir "." folder. Unfortunately there is no feasible way to avoid this error, sorry.
Mh I cannot confirm this. I played a bit with creating directories using CreateDirectory and I always get error 123 if the new directory would contain invalid characters.
I other words: I don't see how Windows handles a single ? character in a special way for directories.

Similiar discussion (same result): http://www.ghisler.ch/board/viewtopic.php?t=13879&highlight=123
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

If try to create folder named " TC also will show msg about existing folder.
When try to create it with md command from TC's command line, I get an error "File not found".

2Lefteous
I played a bit with creating directories using CreateDirectory and I always get error 123 if the new directory would contain invalid characters.
In that topic nobody told about OS which used...
I have only WinXP SP2 Pro Russian.
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2DrShark
In that topic nobody told about OS which used...
I'm using Windows XP SP2 German here and I'm quite sure that the same error is returned on other operating system versions.
User avatar
Motorocker
Member
Member
Posts: 105
Joined: 2006-07-19, 10:52 UTC
Location: Perm, Russia
Contact:

Post by *Motorocker »

What for Total tries to create folders with names of existing files and folders or with "?*" symbols?

I have file or a folder 123
I try to create a folder with same name 123
Total shows the message:
-----
Error: Directory [123]
already exists!
Please specify a different name.
-----

I don't have any advantage from this message.

Please, show again dialog for folder creation a still time - in fact clearly, that I'll press F7 again.

Also:
Try to rename any file with symbols (? " */\ |) on desktop of Windows XP and you'll see not modal usually message.
Graphics Converter – images conversion
KillOK – Cease to press OK!
NSCopy – copy unreadable
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

Why all this behaviour which will not be changed? It's wrong. Or it is in plans for TС 7.5?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, this will need translation, and would cause a 1-2 month delay in the release of the new version...
Author of Total Commander
https://www.ghisler.com
Post Reply