I have a related kind of problem. When preparing notes for a class, I may end up with 70 code blocks in an org file, many of which create graphics. I am always worried about accidentally using the same filename and overwriting a graphic from an earlier block. A unique, but reproducible filename would be sufficient for my needs.

John

John

-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Fri, Oct 11, 2013 at 9:56 AM, Henning Redestig <henning.red@gmail.com> wrote:
I collaborate with different people on the same orgfile which contains many source blocks that generate graphics by e.g. :results graphics abc.pdf

It can happen that I or someone else accidentally create another independent source block that overwrites my abc.pdf which is of course very bad.

I would like to add functionality so that org-babel-execute-src-block checks if in :results graphics FILE, FILE is already referred to by another source block and if so refuse to evaluate.

However, I only see a org-babel-after-execute-hook but no org-babel-before-execute-hook

any reason for this? I could try to write a patch but thought I'd ask first.

....or if there is an even better approach to avoid overwriting output from different source blocks..

//Henning