safe_download.Rd
Safe Download
Downloads a file and tries hard to tidy up in the event of errors. Since these files are typically large we don't want to leave them in temp directories.
The destfile should only appear if the download was successful.
safe_download(url, destfile, fvalidate)
src for the download
destination filename
a fn that is passed the filename after download to validate it in some way. The fn should return TRUE if the file is valid.