{"id":1287,"date":"2010-03-17T00:01:48","date_gmt":"2010-03-17T08:01:48","guid":{"rendered":"http:\/\/www.wambooli.com\/blog\/?p=1287"},"modified":"2010-03-16T14:52:44","modified_gmt":"2010-03-16T22:52:44","slug":"send-that-file-to-hell-part-ii","status":"publish","type":"post","link":"https:\/\/www.wambooli.com\/blog\/?p=1287","title":{"rendered":"Send That File To Hell, Part II"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.wambooli.com\/blog\/wp-content\/uploads\/2010\/03\/mac-trash.png\" alt=\"\" title=\"mac-trash\" width=\"79\" height=\"85\" class=\"alignleft size-full wp-image-1296\" \/><br \/>\nWhat happens when you delete a file? No, not that Recycle Bin stuff. I&#8217;m talking what happens when you <em>really<\/em> delete a file.<br \/>\n<!--more--><br \/>\nBack in the Days of DOS, deleting a file was something that couldn&#8217;t be undone, not using DOS. It took Peter Norton to take advantage of a lazy trick that DOS uses and make a mint with his Unerase program.<\/p>\n<p>To understand how a file is deleted you need to know how a file is stored.<\/p>\n<p>Files have two parts. First there is the file&#8217;s raw data, the information that makes up the file. It&#8217;s essentially a chunk of bytes stored somewhere in the PC&#8217;s storage system.<\/p>\n<p>Second there is a reference to that information. The reference includes the file&#8217;s name, date and time stamps, size, attributes, plus a location on a map. That map location tells the operating system where to find the file&#8217;s real guts.<\/p>\n<p>All that information \u2014 name, time, size, and so on \u2014 formed the file&#8217;s directory entry.<\/p>\n<p>The map was located on a separate part of the disk. In older versions of DOS, the map was the File Access Table or FAT. So the directory entry contained a link to the map, and the operating system used the map to locate the file&#8217;s actual data on disk.<\/p>\n<p>I hope that all makes sense.<\/p>\n<p>When a file is created, DOS looked on the map for a place to put the file. Once a chunk of disk is found, the directory entry is created and the information is written to disk.<\/p>\n<p>When a file is deleted, DOS looks only at the directory entry. It changed the first character of the file&#8217;s name to hexadecimal value <code>F6<\/code> (I believe). It then looked at the spot on the map where the file was located, and it changed the map to show that the space was &#8220;available.&#8221;<\/p>\n<p>Contrary to all logic, DOS did not erase the file&#8217;s data; the data stayed on the storage media. Further, the full directory entry stayed as well; only the first character of the filename was changed. It&#8217;s that weakness that allowed files to be recovered.<\/p>\n<p>What Norton&#8217;s Unerase utility did was to search the directory for files starting with the <code>F6<\/code> character, files flagged as &#8220;deleted.&#8221; It then checked the map to ensure that nothing else was occupying the file&#8217;s former location. If all was okay, the utility simply prompted you for the file&#8217;s first letter. You typed in the letter, and the utility updated the directory entry, then marked the map to show the space once again used.<\/p>\n<p>The news here is that today&#8217;s operating systems also follow the lazy method for removing files: When a file is seriously deleted, only the file&#8217;s directory entry and its reference on the disk map are zapped. Theoretically, it&#8217;s always possible to recover deleted data on computer storage.<\/p>\n<p>Next blog post I&#8217;ll discuss what can be done to seriously, <em>seriously<\/em> delete files and their data.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What happens when you delete a file? No, not that Recycle Bin stuff. I&#8217;m talking what happens when you really delete a file.<\/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-1287","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\/1287","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=1287"}],"version-history":[{"count":5,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1287\/revisions"}],"predecessor-version":[{"id":1301,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1287\/revisions\/1301"}],"wp:attachment":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}