+Bad dir opened on cd stuff /a or cd stuff \3
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Hmm, but doesn't it fail also when "Stuff " actually exists?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I created directory "F:\Stuff \" near existing "F:\Stuff\" and tried it. This code creates directory "F:\Stuff \11":
So it works for path with spaces at the end of directory names when such directories exist.
Code: Select all
int r=SetCurrentDirectory("F:\\Stuff \\");
CreateDirectory("11", 0);
That's true, but I see several side effects.MVV wrote:Thanks, works much better in 8.50b10!
TC doesn't enter non-existing folder more.
* Create folder "tmp"
* Rename folder to "tmp "
* Rename folder to "tmp3"
* Rename folder to "tmp "
* Now 2 folders are created, "tmp " and "tmp"
* Place cursor on "tmp " (with trailing space)
* Del "tmp " (with trailing space)
* Now 2 folders are deleted, "tmp " and "tmp"
There are now variable results when creating and renaming and deleting folders with trailing spaces. For example, if I create a folder "z " with trailing space and no backslash, sometimes the folder is created with trailing space but mostly not.
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
That's what I meant with side effects! I will revert to how it was in TC 8.01.
Edit: It seems that the delete error was already in TC 8.01 too...
Edit2: The second dir creation has nothing to do with spaces at the end, you also get an error when trying to rename tmp3 to tmp\ (reason: TC tries to create dir tmp\ and move tmp3 inside).
Edit: It seems that the delete error was already in TC 8.01 too...
Edit2: The second dir creation has nothing to do with spaces at the end, you also get an error when trying to rename tmp3 to tmp\ (reason: TC tries to create dir tmp\ and move tmp3 inside).
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Confirmed.ghisler(Author) wrote:Edit: It seems that the delete error was already in TC 8.01 too...
Well, it isn't in TC 8.01. So this seems to be a side effect.MVV wrote:I think TC shouldn't move dir if its name after slash is not specified. E.g. rename tmp3 to "tmp \" is rename only while rename tmp3 to "tmp \1" is move with rename.
Confirmed for 8.01 and 8.50b10.MVV wrote:BTW if I move dir "tmp " to other dir, it loses space at the end.
It may be a side effect of something but not changing directory with cd command.Well, it isn't in TC 8.01. So this seems to be a side effect.

BTW I tried to rename dir "xxx" to "yyy\" in TC 7.56a and TC 8.01 and they simply renamed it w/o moving to subdir. TC 8.50b1-8.50b9 show error message and create folder yyy. So I think it should be changed back to older behaviour with ignoring backslash at the end of name. But here we can apply new feature to keep spaces if slash is specified.
TC 8.50b2 can't be started directly because of expired message (bad thing for testing purposes but may be easilly overriden using RunAsDate).
Confirmed. So it's probably a side effect of:MVV wrote:It may be a side effect of something but not changing directory with cd command.Well, it isn't in TC 8.01. So this seems to be a side effect.
BTW I tried to rename dir "xxx" to "yyy\" in TC 7.56a and TC 8.01 and they simply renamed it w/o moving to subdir. TC 8.50b1-8.50b9 show error message and create folder yyy.
HISTORY.TXT wrote:13.02.13 Added: Rename file (main program or sync tool): If the user specifies a directory, e.g. subdir\file.ext which doesn't exist yet, create it (32/64)
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Yes, this is the problem, I didn't check whether there was anything after the backslash or not.
Can you give me an example when this happens?
I couldn't reproduce this - TC should never create folders with trailing spaces directly. The only way to create them is by renaming an existing folder.There are now variable results when creating and renaming and deleting folders with trailing spaces. For example, if I create a folder "z " with trailing space and no backslash, sometimes the folder is created with trailing space but mostly not.
Can you give me an example when this happens?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I cannot reproduce anymore. Makes me wonder if I was mistaken. I suggest to ignore my statement. I will see if I can find anything wrong with the next version.ghisler(Author) wrote:I couldn't reproduce this - TC should never create folders with trailing spaces directly. The only way to create them is by renaming an existing folder.There are now variable results when creating and renaming and deleting folders with trailing spaces. For example, if I create a folder "z " with trailing space and no backslash, sometimes the folder is created with trailing space but mostly not.
Can you give me an example when this happens?
Tested OK using TC 8.50b11 32bit.HISTORY.TXT wrote:21.11.13 Fixed: Inplace rename "test" to "test2" -> TC created test2 instead of renaming (due to the backslash) (32/64)
...
21.11.13 Fixed: Delete folder "test " directly (not to recycle bin) -> also deleted folder "test" in same directory (with warning) (32/64)
I did quite some tests and couldn't find much wrong. I found a minor issue when doing "cd stuff \a" or "cd stuff /a" (on command line). If the folder "stuff " exists and "stuff" does not, the command does not enter the folder but only put the cursor on the folder. If the folder "stuff " and "stuff" both exist then the command does enter the folder.