{"id":163,"date":"2005-07-01T17:07:01","date_gmt":"2005-07-01T20:07:01","guid":{"rendered":"http:\/\/www.hoogervorst.ca\/arthur\/?p=163"},"modified":"2005-07-01T17:12:01","modified_gmt":"2005-07-01T20:12:01","slug":"teh-itnegers-dnot-wrok","status":"publish","type":"post","link":"http:\/\/www.hoogervorst.ca\/arthur\/?p=163","title":{"rendered":"Teh Itnegers dno&#8217;t wrok"},"content":{"rendered":"<p><span class=\"dropcap\">D<\/span>oing a file search on files I saw one of the counters of My Homemade File Finder (that isn&#8217;t here yet) display negative values. After it hit the 2047 MB mark (or around that). Consistently.\n<\/p>\n<p>This is logical: when accumulating the size of a file (bytes in integers), I passed that value to a function that converts it into a readable amount of MB. Stupid mistake: the maximum value of an integer (in Delphi and even VB)  is <em>2,147,483,647<\/em>. So the maximum value that particular variable could store is an amount of 2 GB. What are you laughing at?\n<\/p>\n<p>That would have worked in the DOS ages, when everybody thought that 2 GB for storing e-mails would be enough. We know better these days. And hey, I have gazillions of stories too about how expensive 100 MB harddrives  were those days.\n<\/p>\n<p>Think about it for a second when you write a File manager that needs to accumulate file sizes: <em>how are you going to display that particular value<\/em>  and <em>how are you going to store it<\/em>.\n<\/p>\n<p><em>Update:<\/em> No I have not considered using Int64s. Int64s are taboos.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Doing a file search on files I saw one of the counters of My Homemade File Finder (that isn&#8217;t here yet) display negative values. After it hit the 2047 MB mark (or around that). Consistently. This is logical: when accumulating &hellip; <a href=\"http:\/\/www.hoogervorst.ca\/arthur\/?p=163\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/163"}],"collection":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=163"}],"version-history":[{"count":0,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hoogervorst.ca\/arthur\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}