-No warning when trying to create existing directory

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

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

-No warning when trying to create existing directory

Post by *MarcinW »

No warning when trying to create existing directory

Steps to reproduce - proper behavior:
1) Ensure that directory TEST doesn't exist.
2) Press F7 and create directory: TEST
3) Press F7 again and try to create directory: TEST
4) Error message appears: "Error: Directory [TEST] already exists! Please specify a different name."

Steps to reproduce - improper behavior:
1) Ensure that directory C:\TEST doesn't exist.
2) Press F7 and create directory: C:\TEST
3) Press F7 again and try to create directory: C:\TEST
4) No error message.

Regards
User avatar
Ovg
Power Member
Power Member
Posts: 755
Joined: 2014-01-06, 16:26 UTC

Post by *Ovg »

Confirmed.
It's impossible to lead us astray for we don't care even to choose the way.
#259941, TC 11.01 x64, Windows 7 SP1 x64
User avatar
Gral
Power Member
Power Member
Posts: 1600
Joined: 2005-01-26, 15:12 UTC

Post by *Gral »

As i guess there is no bug here. It's esentially the same as where you create e.g.
1) TEST
2) TEST\TEST2 -> no error message although TEST already exists
3) TEST\TEST2 again -> still no error massage, now both TEST & TEST2 directories exists.

You create entire PATH (nested directories), no single DIRECTORY!

Explanation: this is probably by design, to avoid unwanted error message while creation path contains slashes/backslahes (and all other signs are valid).
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Post by *gdpr deleted 6 »

@Gral, No. The important aspect is "user intention".

In your example, at point #3 my intention is to create directory "TEST2" within "TEST".
If this fails (which it does, because it exists already, see your point #2), TC should produce an error message.

Note, that my intention is not to create "TEST". I just assume it exists already. If my assumption is wrong, TC will just create that directory for me. However, if my assumption was wrong and "TEST" is the name of an existing file, or access permissions are against me, etc..., TC has to throw an error message (which it does).

You might argue that by specifying "TEST1\TEST2\TEST3", your intention is to have these 3 (nested) directories to be created. But this argument ignores that you deal with a path. A path always refers to a single file or directory (unless you use wildcards, which does not apply for this feature, i guess) -- by providing that path, you express the intention to actually create "TEST3" (within the other directories). If "TEST3" cannot be created because it already exists, well,...
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It's as user Gral describes it: When there is a backslash in the name, TC creates entire path (multiple subdirs). It does not warn when parts of that path already exist. However, it shows an error when there is a file with that name. Example:

1.
- File C:\TEST\test.txt exists.
- User is in C:\ and presses F7, then enters TEST\test.txt -> error

2.
- Directory C:\TEST\TEST2 exists.
- User is in C:\ and presses F7, then enters TEST\TEST2 -> no error
Author of Total Commander
https://www.ghisler.com
Post Reply