{"id":661,"date":"2009-06-17T00:01:04","date_gmt":"2009-06-17T07:01:04","guid":{"rendered":"http:\/\/www.wambooli.com\/blog\/?p=661"},"modified":"2009-06-16T15:38:23","modified_gmt":"2009-06-16T22:38:23","slug":"the-history-of-the-forbidden-character","status":"publish","type":"post","link":"https:\/\/www.wambooli.com\/blog\/?p=661","title":{"rendered":"The History of the Forbidden Character"},"content":{"rendered":"<p>You can name a computer file using dozens of characters. Well, except for an annoying few.<br \/>\n<!--more--><br \/>\nBack before Windows 95, filenames on PCs were limited to only 8 characters. Yep, that was a pain, which is why Windows 95 took off so quickly: Windows 95 allowed much, much longer filenames.<\/p>\n<p>Presently Windows lets you name files with tremendously long names. I don&#8217;t recall the exact number, but you can name your computer files something over 200 characters long. That&#8217;s pretty ridiculous, but it&#8217;s a welcome feature over the old 8 character limitation.<\/p>\n<p>In my books, I tell my readers that they can use any combination of letters, numbers, or spaces to name a file. That&#8217;s the easy way to remember things. You can also use a smattering of symbols to name a file, but that&#8217;s where things get tricky; Windows doesn&#8217;t allow just any character to be used in a filename.<\/p>\n<p>The current list of restricted characters is as follows: <code>: ? \" * \/ \\ < > |<\/code><\/p>\n<p>When you attempt to name a file using one of those character, you&#8217;ll get a warning from Windows. You won&#8217;t know which character is offensive; Windows simply bans the entire name and urges you to try again. That&#8217;s understandable, but why?<\/p>\n<p>The characters are not really so much forbidden as they are <em>reserved<\/em>. That means that the characters have a special use in the operating system. Despite what you think you know, the fact is that Windows remains a command-line operating system, and those characters hold special meaning at the command prompt.<\/p>\n<p><strong>? and *<\/strong> These are filename wild cards, used to match single or multiple characters in a filename.<\/p>\n<p><strong>&#8220;<\/strong> The double quote is used to enclose long filenames containing spaces.<\/p>\n<p><strong>\/<\/strong> The slash should be part of a filename, but it&#8217;s not. That&#8217;s because the slash is used to specify options for command line programs. (If you&#8217;re going to put a date in a filename, use a hyphen instead, or just crunch the date all up as I do: <code>20090617<\/code>. That&#8217;s cryptic, but it sorts well.)<\/p>\n<p><strong>\\<\/strong> The backslash is used as a pathname separator, which identifies folders for Windows when it finds files.<\/p>\n<p><strong>< > and |<\/strong> These characters are used for input\/output redirection at the command prompt.<\/p>\n<p>A filename in Windows can contain as many spaces or periods as necessary, but no single space or period at the end of a filename. Further, the filenames <code>.<\/code> and <code>..<\/code> are reserved as shortcuts to the current and parent folder, respectively.<\/p>\n<p>There are also reserved filenames in Windows. These are the names of devices used at the command prompt: <code>AUX<\/code>, <code>CLOCK$<\/code>, <code>COM1<\/code>, <code>COM2<\/code>, <code>COM3<\/code>, <code>COM4<\/code>, <code>COM5<\/code>, <code>COM6<\/code>, <code>COM7<\/code>, <code>COM8<\/code>, <code>COM9<\/code>, <code>CON<\/code>, <code>LPT1<\/code>, <code>LPT2<\/code>, <code>LPT3<\/code>, <code>LPT4<\/code>, <code>LPT5<\/code>, <code>LPT6<\/code>, <code>LPT7<\/code>, <code>LPT8<\/code>, <code>LPT9<\/code>, <code>NUL<\/code> and <code>PRN<\/code>. You can&#8217;t name a file after any of those weird things.<\/p>\n<p>Now with all that nonsense, you can see why my advice is simply put: name a file using letters, numbers, and spaces. That works.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can name a computer file using dozens of characters. Well, except for an annoying few.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-661","post","type-post","status-publish","format-standard","hentry","category-main"],"_links":{"self":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=661"}],"version-history":[{"count":7,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/661\/revisions"}],"predecessor-version":[{"id":668,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/661\/revisions\/668"}],"wp:attachment":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}