Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot create a directory named "Aux" or starting by "Aux." on Windows 8.1

Tags:

windows-8.1

I just encountered a really weird bug on Windows 8.1.

I can't seem to be able to create a folder named Aux or starting by Aux.. I tried on every disk, but I get the following message every time: Le nom du périphérique spécifié n'est pas valide (The name of the specified device is invalid).

Why is that? Is there a specific/valid reason? Is it specific to my computer?


I discovered this because I programatically created a folder named Aux and I can't delete it anymore. I guess I have to run a script or program to get rid of it. (As it usually happens with such scenario on Windows)

like image 950
Vadorequest Avatar asked Mar 25 '16 18:03

Vadorequest


2 Answers

aux, prn, and con (among some others) are reserved for legacy reasons. prn refers to the printer, for instance, and con refers to the standard keyboard (console). It's a remnant of MS-DOS retained for compatibility reasons, I'd guess.

You can still see con in use at a command prompt: type copy con test.txt in a folder where you have write access, type some text, and hit F6 to commit to disk, and then type test.txt to display what you typed on the screen.

There's a bunch of information in Naming Files, Paths and Namespaces (Windows) - for the parts that are relevant to your question, see the section with the bullet points, specifically this item:

  • Do not use the following reserved names for the name of a file:

    CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed immediately by an extension; for example, NUL.txt is not recommended. For more information, see Namespaces.

like image 99
Ken White Avatar answered Nov 07 '22 16:11

Ken White


I'd like to add my experience : If your machine has windows and ubuntu dual boot, delete it from ubuntu filesystem.

Also in Ubuntu, I don't know if it is a problem with git or ubuntu, when i cloned a certain project which had a file named 'aux.c' in it, there was an error saying 'encountered an error while cloning aux.h and aux.c ...'. I used

git clone [project-git-url]

If we only download the .tar file and then extract it, even then an error was encountered.

So, this is a really idiotic bug and I hate MS-DOS btw.(who even uses MS-DOS nowadays?)

like image 32
shaleenbathla Avatar answered Oct 05 '22 02:10

shaleenbathla



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!