Is there a way to prevent Brainstorm from deleting temporary/intermediate files after processing or on exit? I’d like to retain them for debugging and reproducibility. If there’s a preference, debug mode, or recommended workaround to keep temp files, I’d appreciate the instructions.
There is not a preference to avoid deleting temporary files.
There are two ways temporary files (tmp files) are created: by Brainstorm of by Plugins functions.
Tmp files created by Brainstorm are deleted by Brainstorm. Tmp files created by Plugin functions are deleted either by the same Plugin or by Brainstorm, this depends from function to function.
For tmp files deleted by Brainstorm, the function file_delete( ) is used.
So, you could place a breakpoint in the file_delete() function and check when it is called to delete the tmp files of interest. Then on that caller function comment file_delete() or make a copy of the tmp files to other place (e.g., with the function file_copy())
For tmp files deleted by Plugins, they can be deleted in several different ways depending on the plugin. Thus you would need to inspect the plugin functions to check where the tmp files are deleted.
Also, temporary files are not deleted on closing Brainstorm.
Adding the preference to avoid Brainstorm delete tmp files (point 1 above) would be a interesting addition.