When running a source block and storing the result in a file the data will first be converted to a table in org-babel-result-cond and then converted back to text when org-babel-execute-src-block writes it to file. This is takes a very long time when the result is big and it is unnecessary. I have attached a patch that makes org-babel-result-cond return the scalar result when it knows the result will be turned into a file. Regards, Bjarte