Add multi-platform remove_file helper

And use it for deleting internal keys
This commit is contained in:
Andrew Ayer
2014-09-12 19:41:54 -07:00
parent 70879eaf57
commit 690dba2f14
4 changed files with 19 additions and 8 deletions

View File

@@ -340,6 +340,13 @@ void touch_file (const std::string& filename)
CloseHandle(fh);
}
void remove_file (const std::string& filename)
{
if (!DeleteFileA(filename.c_str())) {
throw System_error("DeleteFileA", filename, GetLastError());
}
}
static void init_std_streams_platform ()
{
_setmode(_fileno(stdin), _O_BINARY);