{"id":7159,"date":"2014-05-27T00:25:09","date_gmt":"2014-05-27T00:25:09","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/27\/free-disk-space-on-a-network-drive-in-delphi-collection-of-common-programming-errors\/"},"modified":"2014-05-27T00:25:09","modified_gmt":"2014-05-27T00:25:09","slug":"free-disk-space-on-a-network-drive-in-delphi-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/27\/free-disk-space-on-a-network-drive-in-delphi-collection-of-common-programming-errors\/","title":{"rendered":"Free disk space on a network drive in Delphi-Collection of common programming errors"},"content":{"rendered":"<p>I am making a program for A2 Computing which exports a lot of data. My HDD allocation on the local network is about 50 MB, so it&#8217;s a good candidate to test the &#8220;no disk space&#8221; error.<\/p>\n<p>Currently when the program runs out of space it crashes mid-export with I\/O Error 112. I would like to warn ahead of time if the file might exceed available space. I know how big the file will be (24.8 bytes per record, on average), so all I need to do is find out how much space is free.<\/p>\n<p>As I am working on a network drive, with a file path like <code>\\\\qmcsan1\\Cxxxxx$\\filename.csv<\/code>, how do I use functions like <code>DiskFree<\/code> to calculate available space? Any such function also needs to handle local drives like <code>C:\/<\/code>.<\/p>\n<p>Any ideas much appreciated.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am making a program for A2 Computing which exports a lot of data. My HDD allocation on the local network is about 50 MB, so it&#8217;s a good candidate to test the &#8220;no disk space&#8221; error. Currently when the program runs out of space it crashes mid-export with I\/O Error 112. I would like [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7159","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7159"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7159\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}