loadsave.c: function Remove_file()

This commit is contained in:
Thomas Bernard 2018-02-16 11:02:28 +01:00
parent 3ed5dc5786
commit 3a0e187d73
2 changed files with 12 additions and 0 deletions

View File

@ -1769,3 +1769,13 @@ FILE * Open_file_read(T_IO_Context *context)
return fopen(filename, "rb");
}
/// For use by Save_XXX() functions
void Remove_file(T_IO_Context *context)
{
char filename[MAX_PATH_CHARACTERS]; // filename with full path
Get_full_filename(filename, context->File_name, context->File_directory);
remove(filename);
}

View File

@ -267,4 +267,6 @@ FILE * Open_file_write(T_IO_Context *context);
/// For use by Load_XXX() and Test_XXX() functions
FILE * Open_file_read(T_IO_Context *context);
/// For use by Save_XXX() functions
void Remove_file(T_IO_Context *context);
#endif