Code: Select all
cd stuff /a
cd stuff \3
Moderators: Hacker, petermad, Stefan2, white
Code: Select all
cd stuff /a
cd stuff \3
[i]Edited[/i] wrote:Above is true when using cd as button command.
When using the cd command on the command line, TC tries to go to folder c:\folder1\folder2\folder3. If c:\folder1\folder2\folder3 does not exist, TC tries to go to folder c:\folder1\folder2 and select file "folder3". If c:\folder1\folder2 does not exist, TC stops trying.
Yes. And if you press F2 (reload) the folder "Stuff" is displayed.MVV wrote:ghisler,
Problem is that TC 'enters' non-existing dir, not that TC enters dir with training space in name. I have no folder "stuff ", I only have folder "Stuff",
ghisler(Author) wrote:OK, I have now added a workaround to not call SetCurrentDirectory if the path contains " " or " /". The problem is that SetCurrentDirectory does not work at all with paths containing spaces at the end.
MVV wrote:Beta 9 still enters non-existing directory "F:\stuff " on cd stuff /a.
Can you trim trailing spaces from the folder before calling SetCurrentDirectory so we get consistent behavior and TC doesn't go into a non existing folder?ghisler(Author) wrote:Sorry, this will not be changed - the risk is too high that when I add extra tests, TC will fail to enter other dirs.
Confirmed.ghisler(Author) wrote:What I added was that you can now go to "stuff " with
cd stuff \
and to "stuff \a" with
cd stuff \a
Unfortunately you could then no longer enter subdir "stuff ". I'm already trimming trainling spaces when you type it without slash or backslash after the space, e.g.Can you trim trailing spaces from the folder before calling SetCurrentDirectory so we get consistent behavior and TC doesn't go into a non existing folder?
I meant to only trim trailing spaces when you use SetCurrentDirectory..ghisler(Author) wrote:Unfortunately you could then no longer enter subdir "stuff ". I'm already trimming trainling spaces when you type it without slash or backslash after the space, e.g.Can you trim trailing spaces from the folder before calling SetCurrentDirectory so we get consistent behavior and TC doesn't go into a non existing folder?
cd stuff<space>
So you can pass path with trailing backslash to SetCurrentDirectory function and it will work only when path is correct. You can do it only for path parts so first call will be with exact path entered by user.SetCurrentDirectory(L"D:\\Stuff") succeeds
SetCurrentDirectory(L"D:\\Stuff ") succeeds
SetCurrentDirectory(L"D:\\Stuff\\") succeeds
SetCurrentDirectory(L"D:\\Stuff \\") fails