by Joshua Harley
23. August 2009 00:41
With the upcoming release of Windows 7 by Microsoft I am still surprised at a limitation of Explorer that has been around since explorer was first introduced with Windows 95. When Microsoft first introduced Windows 95 they included long filename support. This long filename support allowed Windows to store a filename of “up to 255 characters” while still maintaining compatibility with DOS and previous versions of Windows.
Remember filenames like LETTER~1.DOC and directories like PROGRA~1? Well, believe it or not they still exist by default in Windows 7! You can confirm this yourself by opening a command prompt and running the dir /x command. This will display files in the current directory with both their long filenames and DOS compatible filenames. Of course you can turn this filename generation off by setting the appropriate registry keys.
Back with Windows 95 the Windows API generally provided only ANSI functions. ANSI strings were either single-byte or a variable-width multi-byte arrays. When Windows NT came along with its new kernel, all of the internal strings were represented in Unicode (double-width) character arrays.
The string "HELLO" in ANSI:
| Byte: |
1 |
2 |
3 |
4 |
5 |
6 |
| Data: |
H |
E |
L |
L |
O |
\0 |
The string "HELLO" in Unicode:
| Byte: |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
| Data: |
H |
\0 |
E |
\0 |
L |
\0 |
L |
\0 |
O |
\0 |
\0 |
\0 |
Along with the Unicode kernel, Windows NT also included updated APIs that used the new Unicode strings. So for every CreateFileA you now had a CreateFileW. To maintain backwards compatibility the original CreateFileA still had the limitation on the length of the path that Windows 95 did. Otherwise known by the macro of MAX_PATH which is defined as 260. Since CreateFileW was a new function, there was no backwards compatibility to maintain, so Microsoft provided a way to provide a path up to 32,676 characters. You can read more about the maximum path length on MSDN.
The drawback of still providing both APIs is that as applications pick and choose they can run into issues with the length of the path. Microsoft Word uses the CreateFileW function which allows them to create longer filenames than explorer can handle. I was hoping that in Windows 7 Explorer would finally be updated to use the Unicode CreateFile function… since Windows 95 was released over 14 years ago.
Unfortunately I ran into Explorer’s 260 character limitation just the other day. One of the deleted files resulted in a path of 273 characters long and the following dialog popped up:
by Joshua Harley
15. January 2009 06:56
So there I was showing David the new Windows 7 beta when we decided to play with the dictation features of Windows (speech-to-text). Naturally during the tutorial we wouldn't say exactly what was requested we would either leave out syllables or leave out whole words directly. We noticed that the tutorial would actually continue as long as you said about 50% of the words but what we didn't know until the end when it told us was it was using that initial tutorial to start training itself. Even more entertaining was their disclaimer and opt-in feature to scan my documents and emails to pick up on words and phrases that were commonly used on my computer. While it seemed like a good idea at the time, we soon found out it was a very bad idea to let it read all of that.
Here are a few sentences produced by speaking (we don't remember what we originally said unfortunately):
None of the league agreed on a dynamic built-in David built-in booya and financing built-in the event is that you cross the border town of Larry G5 to one Friday in your beta kit that the Olympic club at the very thing the government meddling in the economy that reenactment of the right file a will he do for a reenactment Cameron raveling and the only and I you are still in the lending law violate the no while they by know about one.
And here is a slightly later one:
I think the people will be downloaded it will really actually help them.
And one more:
Dictating is a bathtub edition and that the man down at the event that palin group that led by David name the other man on the red onion home directory and the drug and weapon that the file recently moved and the government the real leaders believe you're a aggressive e-mail at it but dictating is a pain the ass.
You can tell that the dictating engine had scanned my emails and documents by noticing the references to the government, the economy and Sarah Palin (don't worry, it's her Wikipedia article). I must say, it was quite an entertaining experience and I will definitely need to reset and retrain the engine if I'm ever going to use it properly.
Inspired by the YouTube video Microsoft Vista Speech Recognition Tested - Perl Scripting.
Bonus YouTube video: An Engineer's Guide to Cats.