diff --git a/nonlib/Loggable.C b/nonlib/Loggable.C index 8e94ea3..e7d7413 100644 --- a/nonlib/Loggable.C +++ b/nonlib/Loggable.C @@ -568,13 +568,21 @@ Loggable::snapshot ( const char *name ) { FILE *fp; - if ( ! ( fp = fopen( name, "w" ) )) + char *tmpname; + + asprintf( &tmpname, ".#%s", name ); + + if ( ! ( fp = fopen( tmpname, "w" ) )) return false; bool r = snapshot( fp ); fclose( fp ); + rename( tmpname, name ); + + free(tmpname); + return r; }