Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I noticed something weird today. On the windows command prompt these are all valid:

cd .....
cd ....
cd ...

these are the more well known versions of parent dir and current dir

cd ..
cd .

What is weird is that other commands fail like dir ......

Why does this happen? Is it the same reason this works: cd foo\\\\\\bar (i'm assuming the parser is greedy?)

share|improve this question

closed as not constructive by DragonLord, Mokubai, Canadian Luke, 8088, Diogo Sep 25 '12 at 0:45

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
cmd.exe or PowerShell? –  grawity Sep 24 '12 at 19:05
    
Perhaps command.com? Or Interix or Cygwin shell? –  Eroen Sep 24 '12 at 23:40
    
this was cmd.exe... Despite being marked as "not constructive" I found that in java new File("....").exists() always returns true. I suspect that these are related. –  mlathe Sep 25 '12 at 21:13

1 Answer 1

up vote 2 down vote accepted

Probably because the programmer that wrote change directory (cd) added that functionality but the directory listing (dir) programmer didn't. The command line is just a collection of little programs. You could maybe ask Raymond Chen about it he writes a blog about the evolution of Windows (and sometimes DOS).

share|improve this answer
    
Yea... I'm a reader of Raymond's blog. I suspect that you are correct. Ugg... I hate windows, why this isn't consistent? –  mlathe Sep 25 '12 at 21:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.