Thursday, May 14, 2020

Don't name ANYTHING AUX, or NUL, or...

Further to my earlier post, I discovered 'aux' is not just a bad choice for folder names, it's bad for ANY file name on Windows!

Apparently back in the Dark Ages (1974 or so) when Bill Gates invented computers, the Interwebs and everything else digital, AUX, NUL, COM3, etc. were deemed names reserved for the OS, "magical files" if you will. That decision lives on through backward-compatibility (c'mon, 1974?! CP/M?! DOS?!?!?).

While working on my project, MS Visual Studio Code happily agreed to let me name a file"aux.yaml". Even though this ominous warning appeared, it let me continue once I appended "yaml" to the name:

 Everything went fine until I tried to add the file to the project's working copy in Subversion. For some reason, no matter how many times I pressed "Add..." in TortoiseSVN, the file refused to appear in the commit list, and failed to adopt its stroppy little blue plus sign in Windows Explorer.

Hmm, let's open it with Notepad++ to make sure the file is OK - nope, Notepad++ complained bitterly about the file when I tried to open it:

So at this point I figure the file was somehow corrupted by my attempts to add it or move it around in the Subversion working copy, let's just nuke it and start over:

OK this is definitely weird.

A few minutes googling produced the answer: open an admin command prompt and delete or rename the file. The command ren \\.\C:\path\to\file\aux.yaml auxiliary.yaml put everything right again - TortoiseSVN happily added the file, Notepad++ opened it with nary a whimper, and Visual Studio Code - well, let's just say it has it's own opinion on file names.


How a 1974 bug still bites Win10 and Azure users

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.