Skip to content

Security guidance files that start with `CON.` fail to checkout on Windows

source/handbook/engineering/security/guidance/CON.1.07_default_device_passwords.html.md and siblings are throwing errors when checking out the repo on Windows.

@jburrows001 Is this naming schema strict or can we change it slightly?

The error

$ git reset --hard origin/master
...

error: unable to stat just-written file source/handbook/engineering/security/guidance/CON.1.07_default_device_passwords.html.md: No such file or directory
Checking out files: 100% (2216/2216), done.
fatal: Could not reset index file to revision 'origin/master'.

When I try to manually name a file as CON.1.07_default_device_passwords.html.md, I see this error,

The specified device name is invalid

The problem

The file name can't start with con. on Windows

The error code "The specified device name is invalid" appears if you try to name a folder with a name which is a restricted MSDOS device name.

MS-DOS Device Driver names cannot be used as file names in Windows. As a result, we are unable to name folders as con, aux, nul, etc.

Microsoft MS-DOS had reserved these names for these system device drivers.

  • CON : Keyboard and display
  • PRN : System list device, usually a parallel port
  • AUX : Auxiliary device, usually a serial port
  • CLOCK$ : System real-time clock
  • NUL: Bit-bucket device
  • A:-Z: : Drive letters
  • COM1 : First serial communications port
  • LPT1 : First parallel printer port
  • LPT2 : Second parallel printer port
  • LPT3 : Third parallel printer port
  • COM2 : Second serial communications port
  • COM3 : Third serial communications port
  • COM4 : Fourth serial communications port

https://answers.microsoft.com/en-us/windows/forum/all/unable-to-rename-a-folder-to-com-errorthe/ff48c793-ab97-4881-952a-df195321c11c


"con" is the name of a system I/O device, the console.

https://superuser.com/questions/86999/why-cant-i-name-a-folder-or-file-con-in-windows

Potential solution

Rename the files

Edited by Eric Eastwood