Jump to content

Why can't one create a folder/file named "CON"?


gaazkam
 Share

Recommended Posts

Before you start complaining about not googling the answer - I did Google search it.



But everything I could find was that CON, COM1, AUX, etc are restricted because they have special meaning - for example, "CON:" mens console. And therefore writing to CON: will result in the text popping up in the console (checked that myself - typing echo "asdf" > CON: indeed resulted in "asdf" showing up).



For me, this still hardly answers the question. I mean, CON: should be something different that "C:\CON" or "C:\CON.txt", shouldn't it? As far as I know, any file or folder or driver on anything is being fully identified by the string containing it's full location and (optionally) it's type extenstion. Therefore I can't see how, for example, the existance of a file "C:\Documents and Settings\Someone\Desktop\c.docx" could result in any ambiguity, as it should be obvious that this Word document is not the C: drive. And similary I can't see how the existance of "C:\Documents and Settings\Someone\Desktop\con.docx" could result in Windows not knowing whether this is a Word document or the console.



Could someone explain this to me? Thanks in advance.


Link to comment
Share on other sites

It's very simple: it's one of the reserved names; that's all.



It's not that Windows couldn't distinguish between a device named CON and a file con.txt; it's simply that they made the decision (more than 20 years ago) to have CON as one of the reserved names.



Reserved names (or reserved words) exist in other areas as well: programming languages for example.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy