{"id":5048,"date":"2013-08-30T00:01:47","date_gmt":"2013-08-30T07:01:47","guid":{"rendered":"http:\/\/www.wambooli.com\/blog\/?p=5048"},"modified":"2013-08-24T18:26:02","modified_gmt":"2013-08-25T01:26:02","slug":"the-miracle-of-file-association","status":"publish","type":"post","link":"https:\/\/www.wambooli.com\/blog\/?p=5048","title":{"rendered":"The Miracle of File Association"},"content":{"rendered":"<p>You don&#8217;t even think about it. Click on a file icon and a program opens. Well, hopefully it opens. When it does, the process is called <em>file association<\/em>. It&#8217;s how all graphical operating systems know which files belong to which programs. It&#8217;s a process that makes your computing world a more sane place.<br \/>\n<!--more--><br \/>\nYeah, you may not think of the computer as having any relationship to sanity whatsoever. To drive home my point, visit with me the dark ages of the command line. The Land Before Windows. The Days of DOS.<\/p>\n<p>Like your computer now, a DOS computer had applications and documents. But if you wanted to edit a document named <code>REPORT.DOC<\/code> you didn&#8217;t just type the name <code>REPORT.DOC<\/code> at the command prompt. If you did, you&#8217;d see the error message:<\/p>\n<p><code>Bad Command or Filename<\/code><\/p>\n<p>That&#8217;s not very helpful, yet it explains why I sold a few million copies of <em>DOS For Dummies<\/em>.<\/p>\n<p>No, to open the document you needed to type the name of the program that created the document. Yep, you had to keep all that in your head. If you remembered, then you could type this command to run the program that created the document and open the document for editing:<\/p>\n<p><code>WP REPORT.DOC<\/code><\/p>\n<p>Again, you can see how people clamored for a book that explained such things in plain language.<\/p>\n<p>Today, you just double-click an icon and off you go. Windows automatically knows which documents belong to which programs. You don&#8217;t even think about it. But nerds like me think about it, so I&#8217;ll spend today&#8217;s blog post explaining a bit how it works and why it may cause you some confusion from time to time.<\/p>\n<p>File association is the art (because it&#8217;s not a science) whereby certain types of files are associated with certain programs. In the case of a <code>REPORT.DOC<\/code> file, Windows looks to the filename extension for a clue. The filename extension in this case is <code>.DOC<\/code>, which pronounced <em>dot-dock<\/em>.<\/p>\n<p>You may not see the <code>.DOC<\/code> part of the filename, but it&#8217;s there. Windows hides the extensions of known file types, which prevents some users from messing with them.<\/p>\n<p>When you try to open a <code>.DOC<\/code> file, Windows looks into its registry to see which program is associated with a <code>.DOC<\/code> file. Most of the time, it discovers that Microsoft Word claims ownership of all <code>.DOC<\/code> files. In that case, Windows fires up a copy of the Word program and passes off the <code>.DOC<\/code> file to that program for editing. Hopefully everything goes correctly.<\/p>\n<p>The association also helps Windows assign icons to the file. For Word, the icon of a <code>.DOC<\/code> file looks like a Word document icon. Now if the same file were associated with another program, it would carry that program&#8217;s icon. In fact, in Figure 1 you see two icons representing the same <code>.DOC<\/code> file, one for Word 2010 and the other for Word 2013. It&#8217;s the same file, but shown by two different icons.<\/p>\n<div id=\"attachment_5068\" style=\"width: 308px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-5068\" src=\"http:\/\/www.wambooli.com\/blog\/wp-content\/uploads\/2013\/08\/0830-Figure1.png\" alt=\"Figure 1. The same document file represented by two different icons.\" width=\"298\" height=\"93\" class=\"size-full wp-image-5068\" \/><p id=\"caption-attachment-5068\" class=\"wp-caption-text\">Figure 1. The same document file represented by two different icons.<\/p><\/div>\n<p>Again, the icon type, as well as the program that opens the icon, is all part of file association. It&#8217;s a good thing, with a good purpose. Don&#8217;t let it confuse you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The often overlooked yet truly basic part of using any graphical operating system is how files &#8220;belong&#8221; to certain programs. Unraveling that mystery will help you to better understand your computer. That&#8217;s a good thing.<\/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":[15,13],"class_list":["post-5048","post","type-post","status-publish","format-standard","hentry","category-main","tag-pc","tag-windows"],"_links":{"self":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5048","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=5048"}],"version-history":[{"count":4,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5048\/revisions"}],"predecessor-version":[{"id":5073,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5048\/revisions\/5073"}],"wp:attachment":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}