- Home /
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.
However,
STR.asset
DEX.asset
ABC.asset
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?
Answer by SwardGames · Oct 26, 2019 at 10:36 PM
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: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN
Your answer
Follow this Question
Related Questions
How do I change the default application used to open logs from the Unity editor? (on Mac) 1 Answer
Editor Window with settings and Asset Creation 1 Answer
Why do my Assets work in Editor and nowhere else? 1 Answer
Import Unity package / Asset by script with selection 0 Answers
Searching for the Dependents of an Asset 4 Answers