Why is "CON.asset" or "CON.txt" not a valid filename?

Due to processing raw data which I don’t control, I require the name of a scriptable object asset to be CON.asset.

Strangely, I get this error when I attempt to save a file with that name:

.../CON.asset is not a valid asset file name. Please make sure there are no slashes or other unallowed characters in the file name. The file will be ignored.



are all fine. You can simulate this by simply renaming an existing file in the editor, even a text file cannot be con.txt, but can be abc.txt.

Why is this? Is there any workaround?

CON used to have special meaning in Windows, so it was forbidden to have any files or folders named that. I don’t know if it still has meaning in modern Windows, but the naming restriction was never removed.

Edit: A complete list of reserved file names can be found here: Naming Files, Paths, and Namespaces - Win32 apps | Microsoft Learn