cdd - is this a bug or a feature?

Dec 26, 2009
11
2
Uranus
#1
TCC latest version. I came across this when I noticed that a batch file wasn't working properly.


E:\Download >

E:\Download > cdd G:

E:\Download > current directory doesn't change

E:\Download > cdd G:\

G:\ > current directory changes
 
#2
I think it acts like CD in that respect. With just a drive specification (no trailing '\') it reports the current directory on the specified drive.
Code:
v:\cksum> cdd v:
V:\cksum

v:\cksum> cdd g:
G:\tc22

v:\cksum> g:

g:\tc22> v:

v:\cksum>
 
Likes: nikbackm
#5
The only thing it "reports" is "G:\"
That would mean that the current directory on the G: drive is the root directory. To see otherwise ...
Code:
( c:\ ) > cdd g:\subdirectory
( g:\subdirectory ) > cdd c:\
( c:\ ) > cdd g:
[code]

That should tell you that the current directory on the g: drive is g:\subdirectory.
 
Dec 26, 2009
11
2
Uranus
#6
I think it acts like CD in that respect. With just a drive specification (no trailing '\') it reports the current directory on the specified drive.
I guess my assumption was that cdd G: would result in changing the current drive to G: since cdd is supposed to mean change drive and directory.

Apparently that is not the case and I have to use cdd G:\

Not a big deal, it just seemed weird.
 
#7
The help backs that up.

"If no drive / path argument is supplied, CDD displays the current drive and directory. "

And for the path argument:

"The name of the directory (or drive and directory) to change to."

So a path argument is definitely required no matter what for a change to it to happen, I suspect avoiding any guesswork on what the drive's current directory is.