Tuesday, October 18, 2005

Stupid Windows Tricks

Pop Quiz
You have a directory with the following files:

monkey.stu
donkey.stupid


At a DOS prompt you type:

dir /b *.stu

What does the DOS prompt display? (Answer below:)

monkey.stu
donkey.stupid


What? Why does the file called "donkey.stupid" match the wildcard string "*.stu"? It should match "*.stu*" but not "*.stu"! The reason is that in Windows all files have equivalent 8.3 filenames. It so happens that the 8.3 filename of "donkey.stupid" is "donkey.stu" so it matches. Just be glad that you didn't run "del *.stu" expecting to delete all the .stu files but not expecting to delete all of the .stupid files!

0 Comments:

Post a Comment

<< Home