utility function to save blend's from a crash (from gdb run this)

p write_crash_blend()

Which will save the current blend name with _crash prefix.
This commit is contained in:
Campbell Barton 2010-06-22 08:38:12 +00:00
parent a25357bbbc
commit eeed68a20f

@ -533,6 +533,22 @@ static ImBuf *blend_file_thumb(const char *path, Scene *scene, int **thumb_pt)
return ibuf;
}
/* easy access from gdb */
int write_crash_blend(void)
{
char path[FILE_MAX];
BLI_strncpy(path, G.sce, sizeof(path));
BLI_replace_extension(path, sizeof(path), "_crash.blend");
if(BLO_write_file(G.main, G.sce, G.fileflags, NULL, NULL)) {
printf("written: %s\n", path);
return 1;
}
else {
printf("failed: %s\n", path);
return 0;
}
}
int WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports)
{
Library *li;