{"id":1408,"date":"2011-08-22T16:00:57","date_gmt":"2011-08-22T23:00:57","guid":{"rendered":"https:\/\/www.reenigne.org\/blog\/?p=1408"},"modified":"2011-08-13T11:50:39","modified_gmt":"2011-08-13T18:50:39","slug":"tinkering-with-the-defragmentation-api","status":"publish","type":"post","link":"https:\/\/www.reenigne.org\/blog\/tinkering-with-the-defragmentation-api\/","title":{"rendered":"Tinkering with the defragmentation API"},"content":{"rendered":"<p>I was looking at the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa363911(v=vs.85).aspx\">Windows file defragmentation APIs<\/a> recently and it made me want to write something that uses them. Not a defragmentation tool necessarily (there are tons of those, and with the advent of SSDs they&#8217;re becoming irrelevant anyway). But maybe something for visualizing how directories, files and other structures are laid out on disk. At one pixel per sector, this would make for a very big bitmap (~25000 pixels square for the 300Gb drive I use for data on my laptop and ~75000 pixels square for the largest 3Tb drives) so I&#8217;d have to make a way to zoom in and out of it. And how should I arrange the sectors within the bitmap? Row major is the obvious way, but a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Hilbert_curve\">Hilbert space-filling curve<\/a> might make for nicer results. For colouring, I was thinking of using the file extension as a hint (e.g. red for images, green for audio, blue for video, grey for binary code, yellow for text, black for free space) and maybe making the first sector of a file brighter or darker so that you can see if it&#8217;s one big file or lots of small ones (though weighting the sector by how much of it is used would have a similar effect). I also want the program to show which sector of which file is under the mouse pointer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was looking at the Windows file defragmentation APIs recently and it made me want to write something that uses them. Not a defragmentation tool necessarily (there are tons of those, and with the advent of SSDs they&#8217;re becoming irrelevant anyway). But maybe something for visualizing how directories, files and other structures are laid out [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1408","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts\/1408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/comments?post=1408"}],"version-history":[{"count":2,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts\/1408\/revisions"}],"predecessor-version":[{"id":1410,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts\/1408\/revisions\/1410"}],"wp:attachment":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/media?parent=1408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/categories?post=1408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/tags?post=1408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}