When your home directory is full, saving defaults would fail without raising an error.

checked all others instances of BLO_write_file give errors too.
When autosave fails it reports an error in the console so its not too annoying.
This commit is contained in:
Campbell Barton 2008-06-12 16:29:00 +00:00
parent 7ffd70f39a
commit 1e7f1f753f

@ -925,7 +925,7 @@ void BIF_write_file(char *target)
writeBlog(); writeBlog();
} else { } else {
error("%s", err); error("failed to write blend file: %s", err);
} }
waitcursor(0); waitcursor(0);
@ -940,7 +940,10 @@ void BIF_write_homefile(void)
/* force save as regular blend file */ /* force save as regular blend file */
write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN); write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN);
BLO_write_file(tstr, write_flags, &err);
if (!BLO_write_file(tstr, write_flags, &err)) {
error("failed writing defaults: %s", err);
}
} }
void BIF_write_autosave(void) void BIF_write_autosave(void)
@ -952,7 +955,9 @@ void BIF_write_autosave(void)
/* force save as regular blend file */ /* force save as regular blend file */
write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN); write_flags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN);
BLO_write_file(tstr, write_flags, &err); if (!BLO_write_file(tstr, write_flags, &err)) {
fprintf(stderr, "failed to write autosave: %s\n", err); /* using error(...) is too annoying here */
}
} }
/* remove temp files assosiated with this blend file when quitting, loading or saving in a new path */ /* remove temp files assosiated with this blend file when quitting, loading or saving in a new path */