{"id":3290,"date":"2020-07-23T13:01:49","date_gmt":"2020-07-23T13:01:49","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=3290"},"modified":"2020-07-23T13:01:51","modified_gmt":"2020-07-23T13:01:51","slug":"delete-file","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/file-input-and-output\/working-with-files\/delete-file","title":{"rendered":"Delete File"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Delete File Function<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;unistd.h>\n\n\tunlink(\"\/home\/pi\/projects\/my_file.conf\");<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Delete Multiple Files Using A Command<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#define DB_FILEIO_DIRECTORY_TEMP\t\"\/home\/pi\/myfolder\/temp\"\n\n\tstring CommandString;\n\n\t\/\/Delete any old files in the \/temp folder\n\tCommandString = \"rm \";\n\tCommandString += DB_FILEIO_DIRECTORY_TEMP;\n\tCommandString += \"\/*.*\";\n\tsystem(CommandString.c_str());<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Delete File Function Delete Multiple Files Using A Command<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[158],"tags":[],"class_list":["post-3290","post","type-post","status-publish","format-standard","hentry","category-working-with-files"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=3290"}],"version-history":[{"count":1,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3290\/revisions"}],"predecessor-version":[{"id":3291,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3290\/revisions\/3291"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=3290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=3290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=3290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}