Added an append/overwrite boolean argument to sdcard writing function.