{"id":1138,"date":"2012-12-14T18:27:14","date_gmt":"2012-12-14T17:27:14","guid":{"rendered":"http:\/\/www.nuonsoft.com\/blog\/?p=1138"},"modified":"2012-12-14T18:27:14","modified_gmt":"2012-12-14T17:27:14","slug":"using-c-standard-library-file-io-in-windows-store-apps","status":"publish","type":"post","link":"https:\/\/www.nuonsoft.com\/blog\/2012\/12\/14\/using-c-standard-library-file-io-in-windows-store-apps\/","title":{"rendered":"Using C++ Standard Library File I\/O in Windows Store apps"},"content":{"rendered":"<p>By default, the following simple piece of standard C++ code will not work in Windows Store apps.<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">wofstream out(L&quot;c:\\\\temp\\\\Data.txt&quot;);\r\nout &lt;&lt; L&quot;Foo&quot; &lt;&lt; endl;<\/pre>\n<p>The reason is that Windows Store apps run with low privileges, meaning that there are restrictions on which files and folders you are allowed to access.<br \/>\nThis is a problem for debugging, because often you want to quickly dump some data to a file and inspect the result.<\/p>\n<p>Luckily, there is a way to make the above code work. The only thing you have to do is to grant &#8220;ALL APPLICATION PACKAGES&#8221; read\/write access to the folder you want. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, the following simple piece of standard C++ code will not work in Windows Store apps. wofstream out(L&quot;c:\\\\temp\\\\Data.txt&quot;); out &lt;&lt; L&quot;Foo&quot; &lt;&lt; endl; The reason is that Windows Store apps run with low privileges, meaning that there are restrictions on which files and folders you are allowed to access. This is a problem for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[190,173],"class_list":["post-1138","post","type-post","status-publish","format-standard","hentry","category-c","tag-all-application-packages","tag-windows-store-apps"],"_links":{"self":[{"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/posts\/1138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/comments?post=1138"}],"version-history":[{"count":6,"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/posts\/1138\/revisions"}],"predecessor-version":[{"id":1144,"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/posts\/1138\/revisions\/1144"}],"wp:attachment":[{"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/media?parent=1138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/categories?post=1138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nuonsoft.com\/blog\/wp-json\/wp\/v2\/tags?post=1138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}